Skip to content Skip to sidebar Skip to footer

Why My Search Code Does Not Work On Internet Explorer

i have the following code for search from database show return result to the page and show them with jqgrid, my code works fine with firefox but its not work on ie, when i use of

Solution 1:

First of all you have problem with quotes in the line where you use setGridParam. Probably you mean

jQuery("#list2").jqGrid('setGridParam',
    {url:"<?php bloginfo('template_url'); ?>/post2.php?firstname="+firstname,
     page:1}).trigger("reloadGrid");

instead of

jQuery("#list2").jqGrid('setGridParam',
    {url:"<?php bloginfo('template_url'); ?>/post2.php?firstname="+firstname",
     page:1}).trigger("reloadGrid");

It seems to me not good to build url with this code. You should at least use something like

jQuery("#list2").jqGrid('setGridParam',
    {url:"<?php bloginfo('template_url'); ?>/post2.php?firstname="
         +encodeURIComponent(firstname),
     page:1}).trigger("reloadGrid");

or

jQuery("#list2").jqGrid('setGridParam',
    {url:"<?php bloginfo('template_url'); ?>/post2.php?"+
         jQuery.param({firstname: firstname}),
     page:1}).trigger("reloadGrid");

Then any international characters from the firstname will be encoded correctly in the url.

One more way is the usage of postData parameter of the jqGrid. See How to filter the jqGrid data NOT using the built in search/filter box for example.

Post a Comment for "Why My Search Code Does Not Work On Internet Explorer"