PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi
I would like to know one thing that how to work out the php code snippets in javascript?
Suppose i have javascript like this
[syntax="html"]<script type="text/javascript">
<!-- TreeView Demo 3 //-->
var palmtree=new jktreeview("tree3")
palmtree.addItem("Coding Forums", "", "http://www.codingforums.com")
palmtree.addItem("PHP Reference", "", "http://www.php.net")
palmtree.addItem("Mozilla Dev Center", "", "http://developer.mozilla.org/en/docs/Main_Page")
var branch4=palmtree.addItem("CSS Drive") //A TREE BRANCH WITH NO URL FOR ITSELF
here i would like to add the php code but not working when i add this code[/syntax]
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
[quote="[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1"][b]2.[/b] Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.[/quote]
Last edited by dharprog on Tue May 29, 2007 7:06 am, edited 2 times in total.
dharprog wrote:In that cat_name is a variable passing.
Did you forget your "$"?
Hi No thats a direct string no need to have "$". I didnt forget about that. Php code is perfect in which in php page thats giving the correct results.
My problem is Thats not coming down to that above javascript code . I mean that results not placing between the javascript code like "palmtree.addItem("CSS Gallery", branch4, "http://www.cssdrive.com")";
So for that what i have to do.
Please tell me is there any tutorials for embedding php in javascript in a right way.
Those are directly priting of the php code out put on right top side (Two lines). Those two lines should come between the javascript code then the fucntion will work.
WHen they clearly place in between javascript then i get the correct output like left hand side like under CSS Drive i get these two "love134d" and "heart" including with CSS Gallery, web desing news and so on...
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
hi
I didnt get the solution. I just added manually those 2 things to show you the output without getting through php code.
Here is the php page code (I mean which you have asked for the html code)
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]