Solved

In Firefox, javascript items displays in asp but not in xmlhttp generated html

Posted on 2007-12-06
9
230 Views
Last Modified: 2013-12-07
Hello,
I have developed an asp site which uses a some external javascript files.
It works on all tested browsers.

When I use xmlHttp to create a HTML version of an asp page, the html page works fine, except in Firefox which does not display the javascript items . If I do a "view source" in Firefox and copy the code into a new html page, it DOES work.
Can anyone advise on how to fix this. Thanks.
Soc.
0
Comment
Question by:shortpan
  • 5
  • 3
9 Comments
 
LVL 17

Expert Comment

by:gops1
ID: 20419229
It is a cumborsome task to make the javascript function work if that is there ins the response object of XMLHTTP. One good solution is move all your javascript function to a seperate js file.
0
 

Author Comment

by:shortpan
ID: 20419584
Thanks, but the javascript is in separate files.
I've noticed problems in Safari also.
The browser redirects to the generated page, but javascript items do not display.
However if it is copied into a new page, it works fine.
S.
0
 
LVL 82

Expert Comment

by:hielo
ID: 20419766
IF you do not have the Firebug extension for Firefox installed yet, go ahead an install it. Then load your page again an see if Firebug reports any javascript errors. It is possible that the page may have a runtime error and is simply halting execution. Hence it never gets to the point that should be rendering whatever items.

On another note, you may get better help/advice if you provide us with a URL to your page.
0
 

Author Comment

by:shortpan
ID: 20421510
Thanks. I have added Firebug.
It shows 7 errors : 5 illegals characters, 2 undefined.
When I run the page again, having replaced its html with its own source code, it shows no errors.

S
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 82

Expert Comment

by:hielo
ID: 20421650
It is not clear if the problem is now resolved. If it is not, provide the code giving you problems.
0
 

Author Comment

by:shortpan
ID: 20428628
0
 
LVL 82

Expert Comment

by:hielo
ID: 20429190
1. The link you provided basically describes "unexpected" characters related to encoding. What you described here was no data at all.
2. That link has a solution for that problem. So it is not clear whether your problem is already solved or not.
0
 

Author Comment

by:shortpan
ID: 20429655
-page.asp dispays fine in IE and Firefox.

-when page.asp converted to page.html using Msxml2.ServerXMLHTTP....page.html displays perfectly in IE. In firefox it displays all content except javascript items such as slideshow from external file.

Using xmlhttp.responseBody instead of xmlhttp.responseText allows Firefox to function, but IE display gobbledygook.. binary array.

I think I need a    FunctionToRemoveSpurious.
S.
    set xmlhttp = CreateObject("Msxml2.ServerXMLHTTP") 

    xmlhttp.open "GET", URLToRSS, false

    xmlhttp.setRequestHeader "Content-Type", "text/html" 

    xmlhttp.send ""

    strHTML=xmlhttp.responseText

    'strHTML= xmlhttp.responseBody

strHTML=FunctionToRemoveSpurious(strHTML)
 

Set fstemp = server.CreateObject("Scripting.FileSystemObject")

Set filetemp = fstemp.CreateTextFile(thefile, true,true)

filetemp.Write(strHTML)

Open in new window

0
 

Accepted Solution

by:
shortpan earned 0 total points
ID: 20441655
This problem was created by the unicode option being set to true for the CreateTextFile method.

Changing it to ascii solved problem.
Thanks for assistance.
S.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
jQuery not working on ELSE... why? 2 25
is this a cms? 8 36
Having problem getting this to work 2 21
How to generate a JSON response in coldfusion 4 24
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.

862 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

24 Experts available now in Live!

Get 1:1 Help Now