embed pinterest code only load first time in ajax loaded page - pinterest

I´m loading one off my pinterest boards in a page loaded with ajax, and the first time I load the page it works and displays my board as it should.
But when I load the page again then it does´t work?
I have tried to set setTimeOut and some other things but I can´t get it to load the board the second time I load the page.
This is the test code I have now:
<a data-pin-do="embedBoard" href="http://www.pinterest.com/pinterest/pin-pets/"></a>
<!-- Please call pinit.js only once per page -->
<script type="text/javascript" async src="//assets.pinterest.com/js/pinit.js"></script>
Solved
Instead off linking to pinit.js in the code I changed it to pinit_main.js and it starts to work.

Related

why is this website stuck in the pre (lazy) loader?

quick cry for help: this website "broke" somehow and is stuck in the pre-loader
https://thelosertakesitall.com/ – I want to understand why and how to fix it, thank you!
I tried removing the elements displaying the loader but then it just stays at a blank screen. I understand the code is old and was set up by someone I do not have contact to anymore.
jQuery is not loaded because of:
Mixed Content: The page at 'https://thelosertakesitall.com/' was
loaded over HTTPS, but requested an insecure script
'http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js'.
This request has been blocked; the content must be served over HTTPS.
try to change
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> <!-- Load jQuery library -->
to
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> <!-- Load jQuery library -->

pinterest widget main.js file not loading

I want to add a pinterest widget to my site. I've customized it and added the code:
<a data-pin-do="embedUser" href="http://www.pinterest.com/bigrockpremiuml/"></a>
<!-- Please call pinit.js only once per page -->
<script type="text/javascript" async defer src="https://assets.pinterest.com/js/pinit.js"></script>
When I then test it in my browser, it cannot find a js file referenced in that script which is this
http://assets.pinterest.com/js/pinit_main.js
The error I get in the console is because it cannot find the file.
file://assets.pinterest.com/js/pinit_main.js
So the browser is looking for the file in my local storage instead of the link....help

Includ mako file once page is loaded

I have a mako file included into a HTML template that takes time to load.
I want to load it only when the rest of the page is fully loaded.
Let's consider this html template fragment:
...
<section>
<%include file="widget.html"/>
</section>
...
I want the line <%include file..., to be read by the browser only when all the rest of page is loaded.
Any idea?
The browser doesn't read the <%include...—it's interpreted by the server before being sent to the browser.
You could have an onload JavaScript call that makes an AJAX request for "widget.html" and puts it in your page.

Website Script that will click on button every x seconds

Is there an easy way of automating clicking on a certain button on a website?
I'm trying to help someone in my company out, the guy basically stares a booking page the entire day, having to click on a single button to refresh the page. If new booking slots becomes available, then it will only be shown on the page on the page refreshes, which means, the guy needs to click on the button the entire day...
Is there a way of maybe automating this? cUrl? Ruby?
If you just refresh the browser to make it refresh then you could try a reload plugin like https://addons.mozilla.org/en-US/firefox/addon/115/. If you actually have to click the button then you could put together a very simple greasemonkey( https://addons.mozilla.org/en-US/firefox/addon/748/ ) script which just simulates a mouse click. With jQuery it would be something like
$("#buttonid").click()
triggered by any one on a hundred timer plugins or setTimout.
First of all i think i have understand your question correctly. What you are trying to do here is that periodically refresh an external web page (say www.google.com)
If so do something like this
create an html page
test.html
and create an iframe inside it and give the url of the web page that you want to refresh
iframe src="http://www.google.com">
and then in the head section add
META HTTP-EQUIV="REFRESH" CONTENT="5" to refresh the page
Ex:
html
<head>
<META HTTP-EQUIV="REFRESH" CONTENT="5">
</head>
<body>
<iframe src="http://www.google.com"></iframe>
</body>
html
Hope you find this helpful (as i said if i understood the question correctly)
cheers
sameera

Facebook dev - loading fbml & html code into a div in an iFrame via Ajax

I've got an iframe application that's working fine and rendering fbml in facebook. But the whole app is built using ajax calls to load large chunks of pages. Several of these have < fb: tags that aren't being rendered when they load. I tried the code below, which is then loaded into a div in my index page, but it doesn't show anything at all, no html, no fb rendering, nothing. Can someone please tell me what I'm missing?? Thanks so much!!
<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>
<fb:serverfbml style="width: 600px;">
<script type="text/fbml">
<fb:fbml>
<!-- all of my html and my php and my fb tags go in here, for example: -->
<fb:name uid="my_real_user_id" useyou=\"false\"></fb:name>
</fb:fbml>
</script>
</fb:serverfbml>
I hope my question was clear. If not, just let me know I'll explain in more detail! :P
have look at this question
Loading Facebook fb:profile-pic via AJAX in Facebook Connect site

Resources