views:

1721

answers:

2

Heres my Situation.

Im trying to relaod a div in a page with load().

I first tryed with a GET. Worked fine with Firefox but not IE8.

After a bit of reading, i found out that i had to POST my PARAM so i went on and did a POST.

The result is just the same. It wont work in IE8. Here is the line im using for the POST.

$(\'#test_1\').load( \'../ajax_http.php\',{variable2:xload})

Firebug, (firefox debug add-on), Is seeing the action as a POST and see the PARAM value So its going trough as a POST but still not working in IE8.

This is the actual line im using:

echo '<div id="test_1" class="test_1" OnClick="$(\'#test_1\').load( \'../ajax_http.php\',{variable2:xload});">';

Any ideas?

A: 

First of all, I'll assume that's a snippet of PHP code. Did you try setting the onclick using the

$("#test_1").click(function(){$('#test_1').load( '../ajax_http.php',{variable2:xload});});

method? It could be an encoding issue. Check the debugger.

thezachperson31
Yes it is output with php as UTF-8.i tried your line. Im no sure where i should use it, im really new to JQuery. So i tried to place your line into the OnClick='' event inside the <div> tag. where my line was and it wasnt working at all. Not even in Firefox. i also tryed the line inside the <script> tag. im getting nothing back and Firebug isnt reporting anything. I dont think im trigering the function the way i use that line
Zero G
Ok got your line to work and i get the same result. Works in Firefox not IE.
Zero G
Firebug still says that everything is fine hes getting the post
Zero G
Zero G
So The funny thing about this is that i managed to get Something to display in my page. I could actualy reach the page with $(\'#test_1\').load( \'../ajax_http.php\',(variable2,xload)variable2 and xload ar both string like xload ="variable2=xload"; variable2 = "a string that isnt showing in the GET param line!?"Firefox is getting the request GET mypage.php?variable2=xload and give me what i want. However IE8 still wont. Now its coming back to how to turn this one into a POST ??
Zero G
$(\'#test_1\').load( \'../ajax_http.php\',(\'variable2\',xload));Actualy display stuff. My php warning becuse variable2 isnt set.
Zero G
A: 

So if IE8 wont let me GET my data I will get it my self! i came up with

function req_product(user,action,product) {
var data = getXMLHttpRequest();

data.onreadystatechange = function() {
 if (data.readyState == 4 && (data.status == 200 || data.status == 0)) {


  document.getElementById("product_box").innerHTML=data.responseText;

 }

};

var sVar1 = encodeURIComponent(product);
var sVar2 = encodeURIComponent(user);
var sVar3 = encodeURIComponent(action);


data.open("GET", "ajax_http.php?variable1=" + sVar1 + "&variable2=" + sVar2 + "&variable3= " + sVar1, true);
xhr.send(null);

}

It's working fine with IE8, Firefox 3.5.1, Netscape9.0 as well as Opera 9.5 So this is where i will start from!

Zero G