Insert PHP code using Javascript?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Bryan_Ruiz
Posted On:   Thursday, June 26, 2003 08:01 AM

Ok, I wrote a nice little php code that takes advantage of javascripts window.open feature in a link. ( make_popup_link($text_of_link, $url); Now that works nice except for one thing.. I am using a javascript code that allows me to see a text box area as WYSIWYG. Thats so I can edit stuff quickly when needed. Because of that, I cannot use the <?php ?> or it will parse the information and when i save the code, and open it back up, the php code is gone.... So i figure I can take javascript and use some kind of script that takes whatever is in some defined file(the php code would be in it) and echo it out into the current document, so this way I can see the links when I use the WYSIWYG Editor... Or is it le   More>>

Ok, I wrote a nice little php code that takes advantage of javascripts window.open feature in a link. ( make_popup_link($text_of_link, $url);

Now that works nice except for one thing.. I am using a javascript code that allows me to see a text box area as WYSIWYG. Thats so I can edit stuff quickly when needed.

Because of that, I cannot use the <?php ?> or it will parse the information and when i save the code, and open it back up, the php code is gone....

So i figure I can take javascript and use some kind of script that takes whatever is in some defined file(the php code would be in it) and echo it out into the current document, so this way I can see the links when I use the WYSIWYG Editor...

Or is it less code to use the javascript code for the popup window?

Get back to me thanks!!!

   <<Less

Re: Insert PHP code using Javascript?

Posted By:   Nitesh_Naveen  
Posted On:   Thursday, June 26, 2003 10:52 AM

Why do you need to pass this to javascript? Inf you want to set the text from php can't you just insert it into the respective div? (guess you are using div element for the WYSIWYG editor. or is it iframe). in case you have a set method defined in javascript to set the text for this editor you can set the text from PHP as setEditorContent($editorText) (taking que from your code above I'm not familiar with PHP) In JSP for eg you use evaluation tags like setEditorContent("<%= editorText %>")
About | Sitemap | Contact