javascript - Syntax error ?callback=jQuery1113 -


i'm trying basic jsonp query going:

<html>     <head>         <script type="text/javascript" src="js/jquery1.js"></script>         <script>             $(document).ready(function(){                 $.ajax({                     url: 'http://www.bing.com/',                     datatype: 'jsonp',                     success: function(datawegotviajsonp){                         var text = '';                         var len = datawegotviajsonp.length;                          $('#text').html(len);                     }                 });             })         </script>     </head>     <body>         <div id = 'text'></div>     </body> </html> 

i'm using ie8 , jquery v1.11.3

  syntax error  ?callback=jquery111309915726215071462_1436849961686&_=1436849961687, line 1 character 1 

what callback? coming from?

if change url 'https://www.bing.com/search?q=hello+world'

i get:

  syntax error  search?q=hello+world&callback=jquery11130544191867791898_1436850255384&_=1436850255385, line 1 character 1 

    <html>         <head>             <script type="text/javascript" src="js/jquery1.js"></script>             <script>                 $(document).ready(function(event){                if (event.preventdefault) {             event.preventdefault();         }         else {             event.returnvalue = false;         }                     $.ajax({                         url: 'http://www.bing.com/',                         datatype: 'jsonp',                         success: function(datawegotviajsonp){                             var text = '';                             var len = datawegotviajsonp.length;                              $('#text').html(len);                         }                     });                 })             </script>         </head>         <body>             <div id = 'text'></div>         </body>     </html> 

// use event.preventdefault.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -