Hi,
I have a couple problems, I\'m hoping someone can help me with. I\'ve been beating my head against a wall for hours now.
My first problem is this:
I have a javascript file that I am including in my main php document.
I include it like this: <script language=\"Javascript1.2\" src=\"js2.php\"></script>
The problem with this is, I have several functions within js2.php that need to be called when a user clicks on an image (my application will dynamically overly some information when they click, and return the screen to previous state when they let the mouse up).
When it\'s included as above, with the src=\"js2.php\", it can\'t find the functions, and IE 5.5 says \"Object expected\" (Bleh, so helpful). However, if I just do:
<script language=\"Javascript1.2\">
Script stuff here
</script>
My mouseovers/mousedowns work.
Why won\'t they work if I just use the src= command?
Problem #2:
I have an array that needs to be split out that's generated from PHP. The problem I am having is twofold:
- It won't split out
- I can't find a way to reliably transfer it to the javascript.
For example, in PHP I generate:
$javastring = "itemArray ='Data|More|Data|more|evenmore|lotsmore'.split('|');"
How do I transfer this to my javascript (js2.php)?
Once it's there, how do I get javascript to split it out. The split() should be doing it, but it's not. I suspect a syntax error somewhere?
Any help would be greatly appreciated.