java script issue
Permalink 1 user found helpful
Hello
I'm trying to add a java script to my C5 site, If I click add block and then html block and copy/paste my script nothing happens, is like I haven't even add it. How can I add one twitter js widget? or for example this script:
<script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script>
<script type="text/javascript" src="http://twitter.com/statuses/user_timeline/beantowndesign.json?callback=twitterCallback2&count=1"></script>
Also does anyone know how to insert external links into image blocks? When I add an image block I can see `the link field but if I enterhttp://www.exemple.com, when I try to click the image it it becomeswww.www.mysite.com/www.exemple.com/...
Thanks
Spike
I'm trying to add a java script to my C5 site, If I click add block and then html block and copy/paste my script nothing happens, is like I haven't even add it. How can I add one twitter js widget? or for example this script:
<script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script>
<script type="text/javascript" src="http://twitter.com/statuses/user_timeline/beantowndesign.json?callback=twitterCallback2&count=1"></script>
Also does anyone know how to insert external links into image blocks? When I add an image block I can see `the link field but if I enterhttp://www.exemple.com, when I try to click the image it it becomeswww.www.mysite.com/www.exemple.com/...
Thanks
Spike
I am having this issue as well. The block with the script exists, but the script does not run.
I ran into these issues myself when making my Twitter Search block.
The problem I ran into is with page refresh -- I had code in my auto.js file than needed to run, and when I added a block via the usual add method, the javascript wouldn't execute properly. The solution for me was a forced page refresh.
You can check out the code here (free to download):
http://www.concrete5.org/marketplace/addons/dkutwittersearch/...
Since this block is adopting twitter APIs the solution should be similar in your case.
The problem I ran into is with page refresh -- I had code in my auto.js file than needed to run, and when I added a block via the usual add method, the javascript wouldn't execute properly. The solution for me was a forced page refresh.
You can check out the code here (free to download):
http://www.concrete5.org/marketplace/addons/dkutwittersearch/...
Since this block is adopting twitter APIs the solution should be similar in your case.
Oh, and while I'm here -- I tend to not use the Image block to link images into my sites. I use the Content block, and add the image through the tinymce editor. By being in the content editor, I get much more control on the positioning and layout of my images.
That doesn't technically answer the "how to do it" question, but its the solution I use...
That doesn't technically answer the "how to do it" question, but its the solution I use...
I also use the content block for images most of the time. My problem is with a script I got from my affiliate network that rotates banners. It is likely keyed to the refresh function because it rotates as new visitors come to the page.
Thanks. I'll review your code.
Thanks. I'll review your code.