What is wrong with this line of javascript?
|
03-26-2014, 01:51 AM
Post: #1
|
|||
|
|||
What is wrong with this line of javascript?
Im new at this, and i really cant get this button to work. I finish, i come back, things were working, then they stop working...i dont know why.
Now SOME of the buttons work, but this one doesnt. This in my .Js. file.... function displayinfo (){ alert("Blah blah blah blah blah"); } and i got this in my html # # # <A HREF="Jdisplayinfo >Important Information</A> # </center> # # # # # # # </body> # # </html> (I dont know why those hashtags appeared when i copied....) I mean, if dont know whats wrong, randomly changing it doesnt seem to help. Any hints? Ads |
|||
03-26-2014, 02:00 AM
Post: #2
|
|||
|
|||
You didn't call the function. Change the html to this.
... href="displayinfo()">... Ads |
|||
03-26-2014, 02:13 AM
Post: #3
|
|||
|
|||
1) A malformed HTML file can interfere with your browser's ability to render it.
2) Your HTML file needs to reference your .js file in order to use any functions in your .js file. I.e. <script type="text/javascript" src="url/to/your/javascript_file.js"/> 3) in your anchor tag, don't forget to type the function call operator. I.e. use "jdisplayinfo()" instead of "jdisplayinfo" |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)