hPage.com Forum
Remember Me?
Go Back   hPage.com Forum > Website editing > JavaScript

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-27-2009, 06:12 AM
Junior Member
 
Join Date: Apr 2009
Posts: 1
Thanks: 0
Thanked 1 Time in 1 Post
Default may i use the java script variable values out side the javascript

hai,

i want to use the js variable outside of the <script> </script> tag.

.............................index.html........... ........
<script language="javascript">
function me()
{
var v=document.f1.s1.selectedvalue;
return v;//// I want this variable to use out side of this script
}
</script>
<form name="f1">
<select name="s1" onChange="me()">
<option>......
</select>

accessing the variable "v" here

</form>


thanq
Reply With Quote
The Following User Says Thank You to rajesh For This Useful Post:
tushirahmed007 (09-13-2010)
  #2 (permalink)  
Old 12-01-2010, 01:50 PM
princepatel
Guest
 
Posts: n/a
Default

I think that you are confused as to server-side code and client-side code. Server-side code will ONLY run BEFORE the page is rendered into the browser. Client-side code will ONLY run AFTER the page is rendered into the browser. No matter what you try to do, you can NOT mix them. The closest that you can come is using AJAX.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 09:59 PM.
Archive - Top