JQuery :: Code - Repeatable - With Firefox 3 And AJAX

Sep 9, 2009

I have found a problem with Firefox 3 and AJAX, and give code to replicate it below.

The problem is when you have a resource, e.g. /docs/1234, which is fetched both directly as a web page and as AJAX (XMLHttpRequest). The server detects these cases based on the X-Requested-With: XMLHttpRequest header, and sends back different content, e.g. just a raw div or wrapped in a full HTML page.

The problem is when you use a jQuery AJAX request to fetch the page again. If Firefox has /docs/1234 in its cache, then load('/docs/1234') wrongly gets the non-XHR version of the page, and this is the version it will insert into the DOM. This screws up the page, since you get a second copy of the layout wrapper HTML inside the original layout.

The code below replicates this:

- The home page (/) fetches /docs/1234 into the lower pane using XHR
- click on the link to fetch /docs/1234 as a full HTML page
- click back, and the main page ends up inserting the full /docs/1234

HTML into the lower pane

You can see that I've set a Cache-Control: header, which ought to prevent /docs/1234 from being cached at all, but that doesn't seem to make a difference. You can confirm it's present using curl -v [url]

This problem doesn't occur with Opera. Looking at the server logs, when you hit Back you see that $.load fetches a new copy of the page, so the AJAX request isn't using a local cached copy. (This is true even without setting the Cache-Control header) So arguably this is a Firefox problem. However, since part of the purpose of jQuery is to abstract away and compensate for browser differences, I thought I'd raise it here first.

The only workaround I can think of is to use a different URL for XHR requests, e.g. add '?xhr=true' to the end.

To run this code, you'll need ruby and 'gem install sinatra'

View 2 Replies


ADVERTISEMENT

JQuery :: Code OK In Firefox But Fails In IE

Feb 17, 2010

I have what I thought was a simple piece of code to count characters in a text area. The code works fine in FF and safari, but not in IE. Can someone explain if the problem is my code or something else.

View 3 Replies View Related

JQuery :: Firefox/Twitter Code Clash?

May 12, 2010

I have created a new theme for Rapidweaver and integrated some neat JQuery animated sliding panels and frankly I was feeling pretty chuffed with my efforts as I am far from a JQuery expert.[URL]..In the side panel on the left, I have embedded a Titter feed widget, lifting the code direct from Twitter. In Safari, Chrome, Opera and even jolly old IE this works fine. But Firefox has a fit and displays a blank page - or just plain won't load. If I remove the Twitter widget the page loads perfectly happily. If I disable Javascript in FF, the page loads (but there is no animation etc) - so there is clearly a JQ/Javascript/Twitter script issue going on here that is causing FF to freak out...

Of course the simple solution is not to add the Twitter feed, but since this is exactly one of the uses I was planning for this sliding panel, that's a fat 'non' option. All the JQuery code I have used for the theme has 'no conflict' calls and I have even added specific calls for specific code - so stuff like:

[Code]...

View 1 Replies View Related

JQuery :: Code Works On Ie7 But Does Not Work On Firefox

Jun 15, 2009

This code works on ie7, but it does not work on firefox. it just shows a alert when focus occur on an element. you can just click something on the page and you will see alert at ie7.

View 1 Replies View Related

JQuery :: Use $.get Without Alert() Code Not Working Into Asp.net Into Firefox?

Jul 4, 2010

When i use $.get without alert() my code not working into asp.net ( updatePanel and ScriptManager for asp.net ). if i use this code in firefox dont work:

[Code]...

View 6 Replies View Related

JQuery :: Code Not Working In Safari And Firefox?

Nov 25, 2010

Why does my below code not work in Safari and firefox? The below code does not call my page method.but it works on IE. Is there any thing need to enable Ajax mehod call.

[Code]...

View 3 Replies View Related

JQuery :: Code Run In Chrome - But Not Firefox Or Internet Explorer?

Jul 18, 2010

I'm running a basic hello world page:

Whenever I open the page in Chrome, my "Hello" message pops up, but in any other of my browsers, it doesn't. This page is also being hosted basically from a file on my computer, on the C drive.

View 3 Replies View Related

JQuery :: Code For Creating A Popup Window After Login Without Address Bar & Status Bar In Firefox And IE?

May 26, 2010

i need window popup ! not div up i tried [URL]... html this link sample ! it is not at all working

View 1 Replies View Related

JQuery :: $.ajax Only Works In Firefox?

Jan 21, 2011

I've been building a site that will rely very heavily on ajax calls to save server load and to spice things up a bit. So, so far I've successfully made several different ajax calls in Firefox. I'm mainly using the following code

[Code]...

View 4 Replies View Related

JQuery :: $.ajax Working With Firefox Not IE

May 14, 2010

I have a jQuery code to allow users to login using a lightbox (URL...) and immediately start downloading files, without being redirected or having the page reloaded. It's perfectly working in Firefox but Internet Explorer keeps showing the login box until I reload the page [code]

View 2 Replies View Related

JQuery :: Ajax Does Not Work In Firefox?

Jul 25, 2010

I am using jquery ajax to retrieve data from an asp.net web service. It works ok in IE8; but when I tried it on Firefox (3.6 or so), it generated an error: parsererror

[Code]...

View 5 Replies View Related

JQuery :: Ajax Not Working In Firefox?

Sep 2, 2009

I'm having an issue in firefox. Here's my ajax call:

$.ajax({
type: "POST",
url: "newcoleng",
data: "F10=Yes&F11=No",
success: function(data){
alert( "Data Saved: " + data );
}
});

The post always comes back a success in both IE and Firefox. The html response comes back as expected when using IE. However, the html response when using Firefox brings back an error from the server instead of what is expected. I'm not sure why there is a difference when using Firefox. My guess is that the content-type that the server is expecting is not correct when using Firefox.

View 27 Replies View Related

JQuery :: Test Code Below Validates A Few Fields Successfully When Tested Using Safari, Opera, Firefox And Chrome?

Mar 22, 2011

The simple test code below validates a few fields successfully when tested using Safari, Opera, Firefox and ChromeDatepicker does not work in IE, although the validations do work as expected. Is there an issue with datepicker and IE? Is there a condition in my code that inhibits IE?

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

[code]....

View 2 Replies View Related

JQuery :: Firefox Not Recognizing Parameters Sent By Ajax?

Mar 26, 2010

I have an Ajax script which works fine in IE, Opera, etc, but not in FF 3.6. It appears the data sent is not recognized. My debug alert to display a simple variable sent is blank. In other browsers it displays fine. I'm developing on my PC so shouldn't have the cross domain issue, I don't think?

Here is the code
function ajaxRequest() {
$.ajax({
type: "POST",
url: 'WTE_HTTP_Submit.cfm',

[Code]....

View 4 Replies View Related

JQuery :: Memory Leak With 1.6.1 Ajax And Firefox 4.0.1?

May 28, 2011

Attached is a sample html file (named jqmleak.html - rename it to remove the txt extension and drop it into your web server to test for yourself) that I've put together to demonstrate a memory leak with the $.ajax function in jQuery 1.6.1 when run in Firefox 4.0.1. The file loads jQuery 1.6.1 from the Google API CDN. Next, a simple function is defined that runs $.ajax to request the html file itself. This function is then set to run once every second using setInterval.

In Firefox 4.0.1, on both Win XP and Linux (ubuntu 10.10, 64-bit), I can watch the amount of memory consumed by Firefox gradually rise. It takes a few minutes for the problem to be observed, because initially the memory will decrease with no other activity in the browser. Then after about 5 minutes or so, I can watch the memory used by Firefox slowly but steadily increase. I can use the handy 'about:memory' tool in Chrome to monitor this alongside other browsers. Chrome, Opera, and IE do not exhibit the same problem with this test. Their memory usage will vary within a range of about 2 or 3 mb, but over a long period of time they do not increase their total amount of memory used. This problem is only happening in Firefox 4.0.1 as far as I can tell (I also used safe mode in Firefox to make sure no plugins were interfering with the test). I have tried both GET and POST methods with the $.ajax call, and with the cache setting both enabled and disabled. The result is the same.

Is this a jQuery problem, or maybe instead a bug with Firefox? I see similar bugs reporting memory leaks in other situations, but usually specific to IE. I was about to report a bug for this, but I thought I'd check here first to see if anyone can duplicate this problem, and/or point out what I should do to prevent the memory leak in Firefox.

View 2 Replies View Related

JQuery :: $.ajax Call In Firefox Doesn't Work?

Aug 24, 2009

I have problem with $.ajax call with Firefox. At all other browsers works fine(Opera, IE6,Chrome) My code:

$.ajax({
url : "statistic_json.php",
type : "post",
dataType : "json",

[Code]....

View 6 Replies View Related

JQuery :: Ajax Post Not Working In Firefox And Safari

Oct 22, 2010

I am doing simple Jquery ajax post to php and I am very new to three languages.[code]...

View 1 Replies View Related

JQuery :: Ajax Post Not Working On Mac - Safari And Firefox

Mar 4, 2011

My website has a JQuery dialog with a textarea where the user can type a text and submit. The submit is an ajax request to the server.

This is the code:

I can see the request on Firebug, so I added and error_log to my code.

The ajax request works perfectly on Firefox, Chrome and IE on PCs, but it does not work on Mac.

View 5 Replies View Related

JQuery :: UI Tabs - Ajax Loading In Mozilla Firefox Only?

Jan 28, 2011

I built jQuery UI tabs with jQuery UI Accordion embedded into each tab. It works fine on my local machine, it also works fine on all browsers in the development server except using Mozilla Firefox.

[Code]...

View 2 Replies View Related

JQuery :: Php Code Not Interpreted With An Ajax Call

Apr 29, 2010

When I try this line on a local server or any ajax call (ajax, get, post)

[Code]...

View 2 Replies View Related

Code Works In Firefox But Not IE 7

Jul 3, 2009

I have created a very simple JavaScript code to display larger images of a thumbnail image on the main section of a website. It works fine in FF3 however in IE 7 is giving me an error code of Invalid argument on line 6 character 1. The funny thing is I have used this exact code in another site and it worked fine with IE 7.

View 2 Replies View Related

Code Not Working On Firefox

Mar 6, 2006

I have the following code:

var ns4 = (document.layers) ? true : false;
var ie4 = (document.all && !document.getElementById) ? true : false;
var ie5 = (document.all && document.getElementById) ? true : false;
var ns6 = (!document.all && document.getElementById) ? true : false;

function show(sw,obj) {
// show/hide the divisions
if (sw && (ie4 || ie5) ) document.all[obj].style.visibility = 'visible'
if (!sw && (ie4 || ie5) ) document.all[obj].style.visibility = 'hidden'
if (sw && ns4) document.layers[obj].visibility = 'visible'
if (!sw && ns4) document.layers[obj].visibility = 'hidden'
}

function showme(myarea,x){
//alert(myarea);
if(myarea==1){
//alert("area is yerushalayim");
show(true,x)
}}

for some reason it's not working at all on firefox -- (the hidden div never gets visible) -- anyone know why and how to fix?

View 2 Replies View Related

Hex Code From BackgroundColor In Firefox

Jun 26, 2006

I want to get the colour in HEX format using "thing.style.backgroundColor". Like "#FFFFFF" or whatever. IE gives this but FF gives it as "rgb(0,0,0)" format.

Is there a simple function/method of getting it as hex? (or a conversion function)

View 3 Replies View Related

Code Not Working For Ie Or Firefox?

Aug 28, 2011

This code works inside my coffee cup test browser but when i test in other browsers it doesnt work at all. none of the features work, drag and drop, highlight text on focus, and cursor change on mouse over.heres a simple code i put together.

<html> <head> <title>sample</title>
<script type="text/javascript">
function handleMouseMove(oEvent) {

[code]....

View 3 Replies View Related

Code Is Not Working In Firefox?

Dec 18, 2011

i have a item switcher i have made in php and java script but for some reason it works in google chrome but not in firefox. The switcher lets the user pick 1 item and make it there active item so they can do things with it.

[Code]...

View 2 Replies View Related

Code Works In Firefox Not In IE

Feb 9, 2010

I've inherited a page that enters data into a database, some of the fields are calculated and one uses today's date. In Firefox it all works fine but in IE it wont load the full page.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved