Scripts within a blog entry...
Scripts within a blog entry...
I am wanting to run a script within a blog entry and not just on the sidebar of my blog site. I have yet to find the plugin that allows this. Does someone else know how to do it so that I can stop looking.
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Scripts within a blog entry...
Hi!
You can embed javascript inside a blog entry. I guess you are currently using the WYSIWYG editor -- this can mess with javascript inside an entry.
So disable the WYSIWYG editor before you want to edit/create a blog entry with such javascript inside, then it should work properly.
Regards,
Garvin
You can embed javascript inside a blog entry. I guess you are currently using the WYSIWYG editor -- this can mess with javascript inside an entry.
So disable the WYSIWYG editor before you want to edit/create a blog entry with such javascript inside, then it should work properly.
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Re: Scripts within a blog entry...
garvinhicking wrote:Hi!
You can embed javascript inside a blog entry. I guess you are currently using the WYSIWYG editor -- this can mess with javascript inside an entry.
So disable the WYSIWYG editor before you want to edit/create a blog entry with such javascript inside, then it should work properly.
Regards,
Garvin
I don't have the WYSIWYG on. What I'm wanting to do is incorporate adwords within my blog entries but it won't show the script for the adwords after saving the entry. It will show adwords in the sidebar but not within an entry itself.
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Scripts within a blog entry...
Hi!
Can you show what exactly you insert into a blog entry, and give a URL to such a blog entry?
When not using WYSIWYG, the <script> should really carry through.
Regards,
Garvin
Can you show what exactly you insert into a blog entry, and give a URL to such a blog entry?
When not using WYSIWYG, the <script> should really carry through.
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Adwords Script
<script type="text/javascript"><!--
google_ad_client = "pub-7327528218451827";
/* 728x15, created 9/2/08 */
google_ad_slot = "6774299535";
google_ad_width = 728;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
By the way, thanks for the help!
google_ad_client = "pub-7327528218451827";
/* 728x15, created 9/2/08 */
google_ad_slot = "6774299535";
google_ad_width = 728;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
By the way, thanks for the help!
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Adwords Script
Hi!
This text contains some special markup bercause of the /* and */ -- if you have the s9y markup event plugin installed, this will transform your manual input to something like <em>...blabla</em>.
You can see that when you view the HTML source of your blog, and circumvent that by either not using this (unneeded) /* ... */ markup, or by removing the s9y markup event plugin.
Regards,
Garvin
This text contains some special markup bercause of the /* and */ -- if you have the s9y markup event plugin installed, this will transform your manual input to something like <em>...blabla</em>.
You can see that when you view the HTML source of your blog, and circumvent that by either not using this (unneeded) /* ... */ markup, or by removing the s9y markup event plugin.
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Unfortunately...
...I tried removing the plugin and it didn't work. I also tried removing the characters and it still doesn't work either! 
-
Don Chambers
- Regular
- Posts: 3657
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
If you look at the HTML source of your entry you will see:
This is invalid javascript. The "<br />"s there are not allowed.
You have several options to remedy this situation:
1. Remove all linebreaks in your blog entry, write everything on a single line.
-OR-
2. Remove the plugin "nl2br". Removing this will also remove any conversion of newlines you might have used in all your other blog postings, so this could be dangerous if you rely on this behaviour.
-OR-
3. Install the plugin "Extended properties for entries". Then edit your blog entry with javascript in it, browse to the bottom and there you should see a list of markup plugins that you can disable conditionally on your posting. Highlight the "nl2br" plugin in that combobox, save your entry, and then for this entry the markup transformation will not be applied.
Regards,
Garvin
If you look at the HTML source of your entry you will see:
Code: Select all
<p><script type="text/javascript"><!-- <br />
google_ad_client = "pub-7327528218451827"; <br />
728x15, created 9/2/08<br />
google_ad_slot = "6774299535"; <br />
google_ad_width = 728; <br />
google_ad_height = 15; <br />
//--> <br />
</script> <br />
<script type="text/javascript" <br />
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> <br />
</script> <br /></p>
You have several options to remedy this situation:
1. Remove all linebreaks in your blog entry, write everything on a single line.
-OR-
2. Remove the plugin "nl2br". Removing this will also remove any conversion of newlines you might have used in all your other blog postings, so this could be dangerous if you rely on this behaviour.
-OR-
3. Install the plugin "Extended properties for entries". Then edit your blog entry with javascript in it, browse to the bottom and there you should see a list of markup plugins that you can disable conditionally on your posting. Highlight the "nl2br" plugin in that combobox, save your entry, and then for this entry the markup transformation will not be applied.
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/