Welcome visitor
* Login
* Register
It is currently September 15th, 2019, 11:58 pm
All times are UTC [ DST ]
* Search
View unanswered posts - View active topics

FORUMS » Client Side » HTML



Post new topic Reply to topic  [ 6 posts ] 
Author Message
  Javascript and Html
PostPosted: February 5th, 2009, 9:33 pm 
User avatar

Posts: 34
hey, i'd been checking that there can be a file with all the javascript stuff, right? so how can i use it? cos im gettin tired of writting the script tags all the time,
and thanks for your help fellas!


Top
 Profile  
 
  Re: Javascript and Html
PostPosted: February 5th, 2009, 9:46 pm 

Posts: 65
ok, to do that you need a .js file with all the instructions for each event. then you need to call this .js file on your html, like on this line i include the abc.js file
<script type="text/javascript" src="abc.js"></script>

and then, you dont need to write the 'script' tag again, you just need to call the specific function for each event.


Top
 Profile  
 
  Re: Javascript and Html
PostPosted: February 5th, 2009, 9:54 pm 
User avatar

Posts: 34
theMatrix wrote:
you just need to call the specific function for each event.

Thank you for your comment MAtrix, now, if is not too much to ask :oops: , can you explain to me a little more about this functions and events things, please? thx!


Top
 Profile  
 
  Re: Javascript and Html
PostPosted: February 5th, 2009, 10:07 pm 
User avatar

Posts: 112
let me help you josh. Ok, once that you create your js file, you need to write in it the functions, or set of instructions, that correspond to each event.

think that you want to change the background-color of an input form when the mouse is over, this would be the hmtl line that calls the js function
<input type="text" name="name" onMouseOver="bgChange();">

and this would be the function on the js file
function bgChange(){
event.srcElement.style.backgroundColor = 'd2b9b2';
}

is this ok?


Top
 Profile  
 
  Re: Javascript and Html
PostPosted: February 5th, 2009, 10:09 pm 

Posts: 65
yeah, mr plugNplay is right, thats what i meant ;)


Top
 Profile  
 
  Re: Javascript and Html
PostPosted: February 5th, 2009, 10:11 pm 
User avatar

Posts: 34
thanks both of you guys, good job!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

FORUMS » Client Side » HTML


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron