![]() |
Building Javascript PHP problem
Hi I'm having difficulty with a display class i've created and how it prints out javascript. I am finding that when i build the javascript using a method in the class then call the method to print out the javascript when building the page html the javascript subsequently wont work however when i simply include the same javascript from an include file i can get exactly the same javascript to work. I'm sure its how its displaying as html but dont know how to resolve or control how the browser formats it. Any guidance?
Here's how the javascript looks in the include file (this works): PHP Code:
PHP Code:
|
RE: Building Javascript PHP problem
captainmerton,
Javascript is not happy with line breaks. I took your posted PHP output, made each JS statement contained on a single line, added an onBlur="inviteFormVerifyMe();" for Email and retypeemail form fields, and it workded lile a champ. Below is the code that works. Scot L. Diddle, Richmond VA Code:
|
Thanks but is there any way to create a string in a php class that contains the entire javascript script code then print it out as html in a way that will work. I dont want to include javascript files in a php class i'd rather build the javascript dynamically i.e. a build javascript method for example. I can get the javascript to work ok its getting it to come out in the html in a format that th browser can use that is th issue.
|
| All times are GMT. The time now is 01:23 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0