[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Json firefox not working, but IE ok.

Posted on 2009-05-14
9
Medium Priority
?
1,006 Views
Last Modified: 2013-12-08
Hi - I have some php code that outputs 4 variables as "yes" or "no", which is called from submitting a form. I'm echoing this as an array and an ajax script is picking it up via a json output.

This works fine in IE, i.e. the script finds the ajax response and processes fine. But in firefox, it stops at the ajax response and I just see the array echoed in the browser as {"var1":"no","var2":"no","var3":"no","var4":"no"}  and nothing happens.

Any ideas?
$myArray = array(
     'var1' => $var1,
     'var2' => $var2, 
	 'var3' => $var3,
	 'var4' => $var4 
); 
 
echo json_encode($myArray);

Open in new window

register.txt
ajax-register.txt
0
Comment
Question by:michaelbrewitt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
9 Comments
 
LVL 1

Author Comment

by:michaelbrewitt
ID: 24390548
Sorry, I forgot to mention, the above works in Firefox if I access /register.php directly. But, loading register/php through a <div>, it breaks as described above.
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 24414907
Please post the Javascript part of the AJAX code in a snippet.  Also the html for the part of the page the script works with.
bol
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 24414915
Could you also look and see if you get a Javascript error in Firefox when you try this?  Provide details if you are getting an error.
bol
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:michaelbrewitt
ID: 24425226
See attached.

Index page loads and first loads the login.php file into a div. If you click on "register" it then loads register.php as attached above.

Incidently, I can get this working fine with the login.php file - it's just the register version which doesn't work.

No errors in firefox/firebug.

Many thanks
index.txt
login.txt
0
 
LVL 1

Accepted Solution

by:
michaelbrewitt earned 0 total points
ID: 24446463
Got it! I removed the $(document).ready() enclosure and bingo, all working fine!
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 24446594
Great!  Thanks for letting me know.   Since I was still just getting attached files I had hesitated to look into this more (I am more cautious about what I download than just what I see in a snippet).
Had you sent me the email with the URL and other info?  I got one but didn't get a URL for the EE question.  I am pretty sure it was you and this one but please confirm.
bol
0
 
LVL 1

Author Comment

by:michaelbrewitt
ID: 24453902
Yes, I sent you an email with the URL.
Glad it's working now, spent way too much time trying to sort it. Thanks for taking the time to have a look.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 discusses how to implement server side field validation and display customized error messages to the client.
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…
How to create a custom search shortcut to site-search Experts Exchange using Google in the Firefox browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…

650 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