Solved

ASP site with Javascript fails to render page in IE 6 or 7 but fine with FF

Posted on 2007-04-09
18
191 Views
Last Modified: 2008-01-09
I am suddenly having trouble with Internet Explorer. Both IE 7 and IE 6 behave the same way - they fail to render the page at all yet do not seem to be detecting any errors on the client side. No errors occur on the web server either.

I've issued VIEW SOURCE on this blank IE screen and captured it to a text file. It looks "complete" to me and I am puzzled as to why it won't render anything.

Yet everything renders fine with Firefox 1.5.0.11 !

I've issued VIEW SOURCE on the Firefox screen and captured it to a text file with a different name. I've compared the IE text file with the FF text file and they are identical.

I've replicated everything on our public web server so you experts could have a look and offer comments or ideas.

Please browse the following and compare Firefox results to IE:

http://gis.cbmiweb.com/MDWmaps/

I am really stumped and hope someone can suggest something.
0
Comment
Question by:jjamjatra
  • 9
  • 4
  • 3
  • +1
18 Comments
 
LVL 25

Expert Comment

by:kevp75
ID: 18877987
there is one thing I notice  (only by lookingquickly of course..)

this line:
<link rel="stylesheet" type="text/css" href="default.css"></>

see the extra </> at the end of the line...it is unneeded
0
 
LVL 20

Expert Comment

by:jitganguly
ID: 18878009
Take off this portion

<script type="text/javascript" language="javascript">
    var stateOfMapserver = "layers%3D0%2C1%2C2%24viewport%3D2%2E1723538776377947e%2B002%2C2%2E1723538776377947e%2B002%2C1%2E1460654220948415e%2B005%2C1%2E0504115842780631e%2B005%24";
</script>
<script type='text/javascript' src="Scripts/+sfgRmluamFuX1R5cGU9amF2YV9zY3JpcHQmRmluamFuX0xhbmc9dGV4dC9qYXZhc2NyaXB0+/Manifold_AJAX.js" ></script>
<!-- content scripting -->
<script type="text/javascript" language="javascript">
<!--
var opera = (navigator.userAgent.indexOf("Opera") >= 0)? true: false;
var ie = (document.all && !opera)? true: false;
var nn4 = (document.layers)? true: false;
var bandH = 480;
var bandW = 640;
var bandX = -1;
var bandXOffset = 0;
var bandY = -1;
var bandYOffset = 0;
</script>

and it works.
So check those faulty JS in IE
0
 

Author Comment

by:jjamjatra
ID: 18878029
Thanks for the quick look. I went to the link statement and tried 2 different things:

a. removing it completely.
b. changing it to a closing tag like this:

          </link>

Neither made any difference so I left it like it was.
0
 

Author Comment

by:jjamjatra
ID: 18878089
Reply to jitganguly:

Please tell me where do you detect "faulty JS"? Neither IE complains about any Javascript problem nor does Firefox.

I cannot take off what you suggest (perhaps I need to repackage it some way). Here is the top snippet from my default.asp on the server side:

<!--#include file="Scripts/Server_Main.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head><title><%= encode(title) %></title>
<script type="text/javascript" language="javascript">
    var stateOfMapserver = "<% = Server.URLEncode(state) %>";
</script>
<script type='text/javascript' src="Scripts/Manifold_AJAX.js" ></script>
<!-- content scripting -->
<script type="text/javascript" language="javascript">
<!--
var opera = (navigator.userAgent.indexOf("Opera") >= 0)? true: false;
var ie = (document.all && !opera)? true: false;
var nn4 = (document.layers)? true: false;
var bandH = <%= cymap %>;
var bandW = <%= cxmap %>;
var bandX = -1;
var bandXOffset = 0;
var bandY = -1;
var bandYOffset = 0;
</script>
<script type='text/javascript' src="Scripts/Client_Functions.js" ></script>
<link rel="stylesheet" type="text/css" href="default.css"></>
</head>
0
 
LVL 20

Expert Comment

by:jitganguly
ID: 18878116
>>Please tell me where do you detect "faulty JS"?
 Here in this
var stateOfMapserver = "layers%3D0%2C1%2C2%24viewport%3D2%2E1723538776377947e%2B002%2C2%2E1723538776377947e%2B002%2C1%2E1460654220948415e%2B005%2C1%2E0504115842780631e%2B005%24";

Open the page in IE where it does not show anything. Do a view source and save teh notepad in html file, take off those JS scripts and open teh html in IE, you can see the page
0
 

Author Comment

by:jjamjatra
ID: 18878220
Dear jitqanquly:

I understand what you are saying. Sure you can strip these lines out and get something to come up in the browser but it has been stripped of all its important content.

Did you attempt to browse the URL with Firefox ? If yes, you should be able to see the image of a map being rendered. Mouseover a polygon for a zipcode and you should see a display of info on the right side of the page.

There are no Javascript errors anywhere in any browser as far as I can see. Please tell me where you see any problem Javascript. Thank you.
0
 
LVL 20

Expert Comment

by:jitganguly
ID: 18878246
Understand you don't want to strip that out. :-)

I just wanted to point out where the error is, I guess IE is unable to parse it.

@ work now, can't use firefox. May be will try @ home.

What if you take off the Server.URLCode
0
 

Author Comment

by:jjamjatra
ID: 18878274
Thanks .... but I still do not see any error with IE.

Can you paste anything about the error you see in IE ? For example, syntax error, object expected, etc. Anything about line number, etc.

I get nothing when I try with IE....just a blank page (yet filled with HTML and Javascript when doing VIEW SOURCE)....but no errors.
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 20

Expert Comment

by:jitganguly
ID: 18878297
I get the same. No error nothig, but just a blank page.

Lets take one at a time

What is this code doing

<%= encode(title) %>

Can I see the code ?

I used to work for a big bank there I had to code separately for NS and IE :-)
0
 
LVL 25

Expert Comment

by:kevp75
ID: 18878321
works great in FF, Netscape, no go in IE6, IE 7, and Opera.

I wonder if there is something in Client_Functions.js that is throwing it off for IE and Opera...
can you post it?
0
 
LVL 25

Expert Comment

by:kevp75
ID: 18878340
that button you have on top..the 'Return To MortgageDataWeb', can you see if that is coded correctly.  Clicking it does nothing but puts an 'undefined' in the address bar...
0
 

Author Comment

by:jjamjatra
ID: 18878400
This reply to kevp75 especially but also jitqanquly...

You should be able to view Client_Functions.js at:

http://gis.cbmiweb.com/MDWmaps/Scripts/Client_Functions.js

also:

http://gis.cbmiweb.com/MDWmaps/Scripts/Manifold_AJAX.js

But more importantly, let me ask you this:

IF there is any client-side Javascript that IE does not like, shouldn't it complain about it in some way? I have visited IE/Tools/Internet Options/Advanced and I have checked "Display a notification about every script error".

During development, whenever I had Javascript errors, IE would definitely complain about it .

Now nothing.....I still would like to know where exactly you see any Javascript error on the client side??
0
 

Author Comment

by:jjamjatra
ID: 18878428
Reply to
kevp75:
that button you have on top..the 'Return To MortgageDataWeb', can you see if that is coded correctly.  Clicking it does nothing but puts an 'undefined' in the address bar...

Yes, I know. This works when linked from another site. When browsing MDWMaps independently, this button will have no return URL. That may behave badly in Firefox when browsing standalone but that is not the problem....I am getting nothing at all with IE.
0
 

Author Comment

by:jjamjatra
ID: 18878464
Reply to jitqanquly question above:

You asked about

This is the server side Javascript function declaration:

// return "&#160;" for empty text and use server encoder otherwise
function encode(text) {
      return (text != "")? Server.HTMLEncode(text): "&#160;";
}

Here is where you saw it invoked in default.asp:

<head><title><%= encode(title) %></title>


0
 

Author Comment

by:jjamjatra
ID: 18884403
Did you guys give up on me?
0
 

Author Comment

by:jjamjatra
ID: 18885348
Never mind. I found out the answer with help from someone on the ASP.NET forum on Microsoft where I posted the question for free and got an answer in 15 minutes.  

I was missing a closing comment

-->

in the inline script block in default.asp. Adding the closing --> fixed the problem completely. Please close this .
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 19561913
PAQed with points refunded (500)

Computer101
EE Admin
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

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

746 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

11 Experts available now in Live!

Get 1:1 Help Now