469,275 Members | 1,497 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,275 developers. It's quick & easy.

JS code check for browser compatibility

296 100+
Please tell me whether the below JS code will run in all the browsers -->

Expand|Select|Wrap|Line Numbers
  1. function getHTML(num) {
  2.         var saf = 0 ;
  3.         var num;
  4.         if(!num) {
  5.             num = document.getElementById('refid').value;
  6.         } else {
  7.             num = num;
  8.         }
  9.         var url = '/cgi-bin/ptts/search.cgi';
  10.         var pars = 'num='+num+'&showallfiles='+saf+'&act=showattachedfilesection';
  11.         var myAjax = new Ajax.Updater( {success: 'placeholder'}, url, { method: 'get', parameters: pars, onFailure: reportError });
  12.     }
Feb 15 '07 #1
3 2514
b1randon
171 Expert 100+
Please tell me whether the below JS code will run in all the browsers -->

Expand|Select|Wrap|Line Numbers
  1. function getHTML(num) {
  2.         var saf = 0 ;
  3.         var num;
  4.         if(!num) {
  5.             num = document.getElementById('refid').value;
  6.         } else {
  7.             num = num;
  8.         }
  9.         var url = '/cgi-bin/ptts/search.cgi';
  10.         var pars = 'num='+num+'&showallfiles='+saf+'&act=showattachedfilesection';
  11.         var myAjax = new Ajax.Updater( {success: 'placeholder'}, url, { method: 'get', parameters: pars, onFailure: reportError });
  12.     }
Everything looks fine but you haven't included the code behind your Ajax object. If you post that perhaps someone will be able to tell you.
Feb 15 '07 #2
pankajit09
296 100+
Everything looks fine but you haven't included the code behind your Ajax object. If you post that perhaps someone will be able to tell you.

Is it mandatory that the data returned by the Perl script should be in XML format as Ajax transactions are through XML ?
Feb 16 '07 #3
acoder
16,027 Expert Mod 8TB
Not necessary. It depends on how you parse/deal with it on the client-side. See a non-XML server response example here.
Feb 16 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Jez Naisbitt | last post: by
3 posts views Thread by Rob Oldfield | last post: by
2 posts views Thread by G2 | last post: by
8 posts views Thread by Amanda H. | last post: by
4 posts views Thread by Maxwell2006 | last post: by
27 posts views Thread by David Golightly | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.