Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Ajax
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Ajax the combination of XHTML, CSS, DOM, XML, XSLT, XMLHttpRequest, and JavaScript
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Ajax section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 27th, 2006, 05:16 AM
Authorized User
 
Join Date: Jun 2006
Location: , , .
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default Firefox javascript error

am using the following code where it is giving me an "Undefined" error
in Firefox while it is running well on IE, the line which cuz the error is "XHR.open("GET",url,true);", any idea ????

var XHR;
function BuildXHR(url)
{
    if (window.XMLHttpRequest)
    {
    XHR = new XMLHttpRequest();
    }
    else if (window.ActiveXObject)
    {
    XHR = new ActiveXObject("Microsoft.XMLHTTP");
    }

    if (XHR == null)
    {
    alert ("Browser does not support HTTP Request");
        return;
    }

    XHR.onreadystatechange = StateChanged;
    XHR.open("GET",url,true);
    XHR.send(null);
}

Reply With Quote
  #2 (permalink)  
Old November 27th, 2006, 10:11 AM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

What is it saying is undefined?

Is there more code? Where is the function StateChanged defined?






Regards,
Rich

--
Author,
Beginning CSS: Cascading Style Sheets For Web Design
CSS Instant Results

http://www.catb.org/~esr/faqs/smart-questions.html
Reply With Quote
  #3 (permalink)  
Old November 27th, 2006, 10:57 AM
Authorized User
 
Join Date: Jun 2006
Location: , , .
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i found the solution, there is something about "cross domain' call, i was calling a page in another domain where
Firefox it seems prevent doing that, but i found the the following code which let me do it but an alert will appear:

try
{
   netscape.security.PrivilegeManager.enablePrivilege ("UniversalBrowserRead");
}
catch(e)
{
   alert("Permission UniversalBrowserRead denied.");
}

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Firefox vs. IE - Javascript problem VerbatimBOT ASP.NET 2.0 Professional 2 September 25th, 2008 03:28 AM
Javascript - Firefox is not supporting lakshmi252002 General .NET 0 April 17th, 2007 12:14 AM
How To Close firefox Window through javascript jitendersingal ASP.NET 1.0 and 1.1 Basics 1 February 13th, 2006 07:36 PM
How To Close firefox Window through javascript jitendersingal BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 1 February 10th, 2006 05:43 AM



All times are GMT -4. The time now is 07:56 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.