SitePoint Sponsor |
|
User Tag List
Results 1 to 6 of 6
-
Jul 29, 2003, 20:59 #1
- Join Date
- Oct 2001
- Location
- Its all about location
- Posts
- 652
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
onmouseover object doesnt support property or method error
I am trying to develop a text editor system for a forum board I am creating, something similar to what sitepoint used to have when adding new topics/replies.
My current problem is trying to get an input type of 'button' to use an onmouseover event that has a userdefined javascript function. My code for the button is as follows:
Code:<input type='button' accesskey='u' style='width: 30px' value='URL' name='btnHttp' onClick="tagInsert('link');" onmouseover="help('u')">
Code:<script language="JavaScript" type='text/javascript'> function help(helptag) { alert(helptag); } </script>
Object doesn't support this property or method.
Why am I getting this error? If I change the onmouseover call to use something like "alert('testing');" the alert works fine. I also tried using window.status='testing'; and it worked fine as well. Why won't it call me predefined function? I have tried changing the name of the function to several different things (in case 'help' was a javascript keyword or something) but that didn't work either. When I remove the onmouseover altogether the page runs fine, without error. What am I missing here?
Please help me. I'm about to pull my hair out.
- krayzie
-
Jul 30, 2003, 01:44 #2
- Join Date
- Jul 2003
- Location
- Moncton, New Brunswick, Canada
- Posts
- 247
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hi,
Works for me, tested it in IE6, N7, Opera 7:
Code:<html> <head> <script type="text/javascript"> function help(helptag) { alert(helptag); } </script> </head> <body> <form> <input type='button' accesskey='u' style='width: 30px' value='URL' name='btnHttp' onclick="tagInsert('link');" onmouseover="help('u')" /> </form> </body> </html>
-
Jul 30, 2003, 05:09 #3
- Join Date
- Oct 2001
- Location
- Its all about location
- Posts
- 652
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You are right, xDev. Trying just that code in an html form works.
However, having the code embedded in my pages still doesn't work. I'm not sure what would prevent it from working correctly. What type of headers need to be sent to correctly make something like this work?
Unfortunetly I don't have this on an external server that you can view yet. My host has had it's ftp access down for the past day so I haven't been able to upload my changes yet. This is all being done on a home server.
The general gist of the page is its a normal php page (far as I can tell) which contains an iframe. Inside this iframe is where the input button lives that is having the problem. Is there anything upfront that you can think of that would be causing the issue? I will post again when I am able to upload the pages to my host.
-
Jul 30, 2003, 05:12 #4
- Join Date
- Jul 2003
- Location
- Moncton, New Brunswick, Canada
- Posts
- 247
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by krayziepjf
-xDevLast edited by xDev; Jul 30, 2003 at 05:23.
-
Jul 30, 2003, 11:47 #5
- Join Date
- Oct 2001
- Location
- Its all about location
- Posts
- 652
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Turns out that 'help' is a reserved keyword. Changing the name of the function to something else did the trick. I swear I tried this last night, but it was 230am so who knows what I was doing anymore.
Thank you for your help xDev!!!
- krayzie
-
Jul 30, 2003, 12:36 #6
- Join Date
- Jul 2003
- Location
- Moncton, New Brunswick, Canada
- Posts
- 247
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by krayziepjf
Cheers,
-xDev
Bookmarks