Solved

window status bar works in dev environment, but not working test environment

Posted on 2007-11-27
19
328 Views
Last Modified: 2012-08-14
Hi,

As my question title, window.status is not working test environment. Of course, the function that contains this line does work fine.

......
......
window.status ="test test"
....
....

thanks,

p.s.
Does this have something to do with web server? This is RoR app and I have weBrick for dev and apache server + mongrel for test.
0
Comment
Question by:dkim18
  • 9
  • 6
  • 2
  • +2
19 Comments
 
LVL 21

Assisted Solution

by:nizsmo
nizsmo earned 100 total points
Comment Utility
Are you able to check if you have any Javascript errors? The javascript should be browser dependent, not server dependent. Also make sure the javascript is enabled on that browser.
0
 
LVL 7

Expert Comment

by:Maverick_Cool
Comment Utility
If you have firefox , go tools check error console.

I aggree with nizsmo that window.status code is part of javascript, hence it is dependent on Client browser not the sever.
May be there some javascript error of previous code which is preventing your code to run.
0
 

Author Comment

by:dkim18
Comment Utility
nizsmo,

I am using same browser (IE) and dev works fine, but test (from remote server) is not working.

Maverick_Cool,

I checked error console, but there was no error.
0
 
LVL 54

Expert Comment

by:b0lsc0tt
Comment Utility
dkim18,

In some browsers (e.g. Firefox) Javascript's ability to change status itself can be disabled.  Have you tested a page on another server or site to see if you see the status message?  In Firefox this is controlled in the setting at Tools -> Options -> Content -> Advanced button to the right of the Enable Javascript checkbox -> Change Status bar text setting.  If that box isn't checked then Javascript won't be able to change the status, even if Javascript is enabled.

I agree with the general comments above though.  This is most likely not server related unless the server is removing the javascript.  Checking the browser html source should quickly let you know if this is happening.  The cause is most likely in the browser if the code is fine.

Let me know if you have any questions or need more information.

b0lsc0tt
0
 
LVL 21

Assisted Solution

by:nizsmo
nizsmo earned 100 total points
Comment Utility
dkim18:

From the same IE browser, there's no reason why it won't work.

>>I checked error console, but there was no error.
So can you see a little exclamation mark at the bottom left of the browser corner on IE, that will often indicate a javascript error.

If that still doesn't solve your problem, maybe making the webpage public so that we can try (maybe just a simple sample code which reproduces the error)
0
 

Author Comment

by:dkim18
Comment Utility
b0lsc0tt,

I followed your instruction and windows status displays fine in firefox, but it is not showing on IE. So this means that there is no code error.
0
 

Author Comment

by:dkim18
Comment Utility
I even grabbed the source code from the browser(test site) and created html file and it works just fine in my local machine.
0
 
LVL 54

Expert Comment

by:b0lsc0tt
Comment Utility
What version of IE?  When you say you ran the html on your local machine what was the "content zone"?  Down in the bottom, right of IE did it show Internet, intranet, local or something else?  What was the protocol (i.e. in address bar, http:, file:, etc)?

If the page was run on showed in the browser as intranet or local content then the security rules for the browser will be different than an Internet page.  Do you have a webserver on your local machine (e.g. IIS) or access to a different web server to test the html as an Internet page?  What is the result?

Since the issue didn't occur in Firefox the code is probably OK but it still is a possible cause.  IE has sometimes not reported Javascript errors in the past for me so I don't trust it much.  Hopefully the content zone will be the issue but otherwise we will probably start needing to look at html.

What do you see in the status bar when you use IE to go to http://www.w3schools.com/js/tryit.asp?filename=tryjs_statusbar ?

Let me know if you have a question or need more info.

bol
0
 

Author Comment

by:dkim18
Comment Utility
The test server is my old machine and it is windows 2000 with IE (6.0) and guess what? It was working there. So, IE(7.0) on my local machine doesn't work.

from the source:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="content-type" content="text/html;charset=UTF-8" />



>>What do you see in the status bar when you use IE to go to http://www.w3schools.com/js/tryit.asp?filename=tryjs_statusbar ?

It only displays "Done" on the status bar.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 54

Expert Comment

by:b0lsc0tt
Comment Utility
OK.  That (the test of going to the w3schools page) confirms the issue is something with your IE browser blocking the script.  If other script works then it is just blocking select parts or just window.status.

Do you have any addons, etc installed?  Try disabling or removing them to see if one is a conflict.  I don't have quick, easy access to IE7 but check in its preferences/settings, especially the security or content area, for a setting that might have to do with window.status.

Did you do the tests for other browsers on the same computer?  If not then try another browser on the same computer.  If those don't work either the cause is probably some program but not one tied to just IE.

The piece of "source" code you posted, that isn't all the html is it?  That little snippet doesn't really help.  It would still be nice to know how you run the file on your "local" computer but if that computer and browser could not see the status when going to the w3schools page then it doesn't really matter.  That was the important test.

Confirm that you tried other browsers on that same local computer with the problem and IE7.  Then let me know about the addons, etc.  If you can't find a setting then I will see what I can do to look for one.  I doubt it is something IE7 won't support so it is probably just a security setting.  Keep in mind this might be something disabled by default (Firefox comes that way I believe) so you might want to make sure the status message isn't important or appears in some other form.  More and more users are disabling it because of its potential for abuse and because the "message" sites show is usually just convenient, not essential.

Let me know if you have a question.

bol
0
 
LVL 17

Expert Comment

by:gops1
Comment Utility
Can you see your status bar:
Check if the status bar is ticked
From the menu click on
View --> Status Bar
0
 

Author Comment

by:dkim18
Comment Utility
b0lsc0tt,

I disabled all Add-ons, but still have the problem. I tested it on IE7 in other machine and same problem. Actully, this is session timer that indicates how much time left. (so, this is ticking clock)

gops1,

yes, i can see the status bar is ticked.
0
 

Author Comment

by:dkim18
Comment Utility
Ok, I added this line

<iframe id="sessionPing" style="width:0px; height:0px; border: 0px" ></iframe>

and it is working on IE7 ONLY when I access the web app locally(accessing dev version that is located in my local machine). Strange enough, the web app in remote server still doesn't display (on IE7 from my local machine) status bar and they are same identical code...

So, I am using same IE7 and it is working when I access the web app in my local machine, but is not working when I access the web app in remote server and there is no code difference.

hm....strange
0
 
LVL 54

Expert Comment

by:b0lsc0tt
Comment Utility
It isn't just your code.  Remember you couldn't see the status on the w3schools page either (unless I misunderstood something).  I haven't had a chance to play with IE7 yet but what about another browser on the same computer.  Did it have the same problem?

Since you had the same issue on another IE7 browser (did it also have the problem with the w3schools page too?) then that gives us a little more info.  It is either a general IE7 issue or something in common on those 2 computers.

Let me know if you have a question or the results of the questions above.

bol
0
 

Author Comment

by:dkim18
Comment Utility
http://www.w3schools.com/js/tryit.asp?filename=tryjs_statusbar

this didn't work on IE7 nor firefox in my machine. I have tested with someone else's machine and IE7 didn't work either.
0
 

Author Comment

by:dkim18
Comment Utility
hm....then why it worked when IE7 in my local machine accessed the web app locally...
0
 
LVL 54

Accepted Solution

by:
b0lsc0tt earned 400 total points
Comment Utility
>> then why it worked when IE7 in my local machine accessed the web app locally <<

I mentioned this in detail before but the security settings are different for local files than for those from Internet.  Remember I pointed out the little "content" image that IE will show at the bottom of the browser (to the right of the status area).  That most likely changes with those local files and probably even says Local or intranet.  It is helpful to know it works but it isn't good to dwell on it and not a fair test.  Since the issue is with an Internet page (or when it is on the web server) the better test was when you went to w3schools, another Internet page.

I hope this clears that question up.  Let me know if you still have a question.  I will look at your other response.  I really think there is some IE7 setting that is causing this.  It means that your message will probably not display by default.   Remember what I said above about Firefox and this possible issue.  I will try to find the setting for you so you can show others how to enable it but you should not rely on showing a status message.  Let me know if you have a question about this or what I said before.

I'll let you know what I find out about IE7 when I get a chance to use it and test.  Hopefully later today. :)

bol
0
 

Author Comment

by:dkim18
Comment Utility
Finally, I found solution:

Status Bar Scripting--Scripts will no longer be able to set the status bar text through the window.status and window.defaultStatus methods by default in the Internet and Restricted Zones. This helps prevent attackers from leveraging those methods to spoof the status bar. To revert to previous behavior and allow scripts to set the status bar through window.status and window.defaultStatus, follow these steps:

   1. Open Internet Explorer, click the Tools button, click Internet Options, and then click the Security tab.
   2. Click Internet or Restricted sites, and then click the Custom level button.
   3. Scroll down to Allow status bar updates via script, select Enable.
   4. Click OK until you return to Internet Explorer.


I will give you points anyway...
Thanks!!!
0
 
LVL 54

Expert Comment

by:b0lsc0tt
Comment Utility
Your welcome!  I'm glad you found a source for it.  It confirms what I said above.  It is actually a good thing in my opinion, the status area was just getting abused and in some bad ways.  Not worth the little benefit it provided. :)

Nice to see the steps in IE7 to reverse it if a user wants to do so in their browser.

Thanks for the grade, the points and the fun question.

bol

p.s.  Please post the link to the page you quoted if you can.  It is important to give credit for content on other sites and the link will probably be useful to others in the future.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
Recently I spent hours debugging an issue in a Rails project where ActiveRecord was causing MySQL errors trying to create a User object of a class at the top level of a Single Table Inheritance model structure.  It turns out `.create` behaves differ…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now