Scripts within a blog entry...

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
tassilyn
Regular
Posts: 7
Joined: Mon Sep 01, 2008 12:15 am

Scripts within a blog entry...

Post by tassilyn »

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...

Post by garvinhicking »

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
# 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/
tassilyn
Regular
Posts: 7
Joined: Mon Sep 01, 2008 12:15 am

Re: Scripts within a blog entry...

Post by tassilyn »

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...

Post by garvinhicking »

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
# 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/
tassilyn
Regular
Posts: 7
Joined: Mon Sep 01, 2008 12:15 am

Adwords Script

Post by tassilyn »

<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!
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Adwords Script

Post by garvinhicking »

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
# 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/
tassilyn
Regular
Posts: 7
Joined: Mon Sep 01, 2008 12:15 am

Unfortunately...

Post by tassilyn »

...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:

Post by Don Chambers »

Can you supply a URL to your site?
=Don=
tassilyn
Regular
Posts: 7
Joined: Mon Sep 01, 2008 12:15 am

Post by tassilyn »

http://www.thechatterbug.com/

It's the most recent post at the top with no topic/subject.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

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>
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
# 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/
tassilyn
Regular
Posts: 7
Joined: Mon Sep 01, 2008 12:15 am

crud

Post by tassilyn »

Well, I should have just removed the line breaks within that specific entry. I removed that plug in and now almost all of my entries are jacked up.
tassilyn
Regular
Posts: 7
Joined: Mon Sep 01, 2008 12:15 am

whew...

Post by tassilyn »

okay... i removed another plugin which corrected what I had messed up. I think we've fixed it!

Thanks for all your time and effort helping me with this. I really appreciate it.

Have a great day!
Post Reply