0

Hey guys I want to load a external link inside an element but nothing happens here is the code I used...

$(window).ready(function() {
  $('#contador').load('http://counter2.freecounterstat.com/private/counter.js?c=36c0ded599f90fd9584581d3e2b02682'); 
});

and the html code ...

<div id='contador'></div>

Thanks!

Musa
  • 96,336
  • 17
  • 118
  • 137
Marcelo Alarcon
  • 394
  • 1
  • 3
  • 17

3 Answers3

0

Its $(document).ready your looking for, the is also $(window).load
Also the resource you want to load is a js file, which utilizes document.write so have to load it inline. Put it as a script tag at the bottom of you page

  <script src='http://counter2.freecounterstat.com/private/counter.js?c=36c0ded599f90fd9584581d3e2b02682'></script>
</body>
Musa
  • 96,336
  • 17
  • 118
  • 137
0

load doesn't load external server but it loads the url from own server.

If you want to load external server see this question

Community
  • 1
  • 1
Bhojendra Rauniyar
  • 83,432
  • 35
  • 168
  • 231
0

.load will open only the links within the site, for other links you have to use html Iframe.

Senthilmurugan
  • 383
  • 1
  • 14