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!

1

3 Answers 3

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>
Sign up to request clarification or add additional context in comments.

3 Comments

I want load the url after window.load
but i want to charge the "hit visitors after all page loaded because the conection to hit visitor is too slow
@MarceloAlarcon That's why its at the bottom of the page, so it loads last
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

Comments

0

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

1 Comment

I want load the url after window.load

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.