|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
help
Code:
<html>
<head>
<script type="javascript">
var message="mwahaha"
function laugh(){
alert(message)
}
</script>
<body>
<form>
<input type="button" name="dabutton" value="click here" onclick=laugh()>
</form>
</body>
</html>
|
|
#2
|
||||
|
||||
|
Hi, mike. In the future, please make an effort to provide a descriptive subject line. Makes it easier for people to help you quickly without wasting time reading posts that they're not interested in.
Your problem here is that your script tag should have the attribute "language" rather than "type" equal "javascript." Presumably, you'd also ultimately modify your function so that it takes the message parameter and so that the click passes the appropriate value.
__________________
Please don't PM me asking for solutions outside the scope of a thread. Keeping all responses in a thread stands to help others who come along later, which is after all what this forum's all about. |
|
#3
|
|||
|
|||
|
And further, you should remember to end all calling of js with a ";" even in the html-tag. Because some Browsers may enterpred it differently if not.
|
|
#4
|
|||
|
|||
|
ah cheers dhouston, all i did was change it to language and it worked!
cheers |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|