Thursday, July 30, 2009

How to add javascript in blogspot (blogger) post

There is a problem. In new line. Every time you have new line blogger editor add <br /> tag. Because of this <br /> tag web browser can't execute jscript.

So correct solution for my problem should look like this:

<a onclick=javascript:showMessage() href="#" >Test</a>
<script language="JavaScript">function showMessage(){alert("Vaseem Ansari welcomes you, Thanks for Visiting my Blog");}</script>

To work well javascript in blogger post should be in one line.


This is example of JavaScript code that works (click on Test to see):
Test

If the script does not work click here


The JavaScript which makes this possible is

<script language="JavaScript">function showMessage(){alert("Vaseem Ansari welcomes you, Thanks for Visiting my Blog");}</script>


If you're new here, you may want to subscribe to my RSS feed.

Thank you for visiting the CodeMasterz Blog (The Vaseem Ansari creation)!

Inspirational Wallpapers, Galleries, Programming Codes, Hacking Tips, Best Quotes, Latest Gadgets, Blogging tips, Wordpress themes and many more like this one are a regular feature of our blog, so if you would like to receive more inspiration from us, please consider subscribing to our feed by RSS or by Email. And if you would like us to notify you whenever a new post is published on our blog you can subscribe for Mobile alerts.

"When someone shares something of value with you and you benefit from it , you have a moral obligation to share it with others."

Let your friends know about the information provided here
Tell a Friend

Keep visiting us daily.
Still if you have any queries then feel free to contact me at  Contact me

0 comments:

Post a Comment

 

About Me

My photo
Hey guys this is Vaseem Ansari, 25 years old, Software & Web Developer, Blogger & works on Open Sources Technologies I love my family and my loved once very much. It takes a while for me to build trust in someone new. I am honest, thoughtful, and my friends tell me that I am wise. I would also say that I am stubborn. but I do learn from my mistakes. I'm Glad I'm Me No one looks The way I do. I have noticed That it's true. No one walks the way I walk. No one talks the way I talk. I am me. There's no one else I'd rather be! Have fun reading this blog and don't forget to subscribe to the feed to keep updated on the latest articles. Visit my Blog at http://www.VaseemAnsari.com/blog/

Followers