954,148 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

how i m putting java script in my blog

how i m putting java script in my blog which is in xml ,my java script code is like


in between which tag i m puting this code my blog is in blooger.com and the code is for mouse crusor effect is blog support mouse crusor effect or not

plz suggest me .....

mairaj
Newbie Poster
6 posts since Sep 2007
Reputation Points: 10
Solved Threads: 0
 

Remove the second and third line.

"language=" is deprecated.

MidiMagic
Nearly a Senior Poster
3,319 posts since Jan 2007
Reputation Points: 730
Solved Threads: 182
 

Hi,
I've found loading complex javascript in blogger difficult! Firstly, even in HTML mode blogger adds
tags, which will obviously break your javascript... if you can, it would be a lot easier to host your javascript somewhere else and import it - but even then, I can't guarantee it would work. You also need to make sure all your functions and global variables don't clash with those in blogger.

Cheers.

alpha_foobar
Junior Poster
182 posts since May 2005
Reputation Points: 20
Solved Threads: 5
 

Will using a separate .js file help?

MidiMagic
Nearly a Senior Poster
3,319 posts since Jan 2007
Reputation Points: 730
Solved Threads: 182
 

still , i m not sucess , plz suggest me in well form. my blog(bhadrak.blogspot.com) is in blogger.com and the java script code is this

mairaj
Newbie Poster
6 posts since Sep 2007
Reputation Points: 10
Solved Threads: 0
 

Hi,
Another file would probably work. Unless it is a naming clash.

But try putting it in a JS file and linking to it from your blog.
Cheers,
Alpha

alpha_foobar
Junior Poster
182 posts since May 2005
Reputation Points: 20
Solved Threads: 5
 

1. Where are your var declarations?

2. This script can't be inside script tags, because it contains a < character.

HTML takes back control when it sees that character. You must create a separate .js file.

3. Do you know which variables are3 global, and which are local. If you don't declare a variable as being global or local (as defined by where its var statement is) the browser has to guess.

MidiMagic
Nearly a Senior Poster
3,319 posts since Jan 2007
Reputation Points: 730
Solved Threads: 182
 

> If you don't declare a variable as being global or local (as defined by where its var
> statement is) the browser has to guess.
Not entirely true. There are two types of variables in javascript -- global scoped variables and function scoped variables. There is no block scope in javascript.

The var declarations only make sense inside a function though it't not illegal to preprend the same when declaring global variables. The browser doesn't need to guess anything. Anything prepended with a 'var' inside a function is a local variable, all other variables are globals except in the case when you declare you own namespace i.e. object literals.

~s.o.s~
Failure as a human
Administrator
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 733
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You