Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
installing a java menu on a wiki
Old 08-22-2008, 05:50 PM installing a java menu on a wiki
Junior Talker

Posts: 1
Trades: 0
Hi,

I know this is probably too basic a question, but I've gone all over the web. Perhaps what I want is covered in basic php- or not, I don't know. I'm new at this.

Problem:

I want to install a java menu on a wiki. The wiki has a LocalSettings.php file, and I put in require_once("includes/call_js.php");

This works to get it to go to the file. What I want to do, is to call up (and have work, heh) two files required for the java menu

/skins/common/menu_com.js

/skins/common/exmplmenu_var.js

I don't know how to call them from a php script. I've looked all over for how to do this, but everything I find is about calling php from java, not the other way around. And there is absolutely nothing about doing it on a wiki.

Perhaps I'm going about it completely the wrong way. The js menu is just supposed to work by having this in the html body:


<script type='text/javascript'>

//HV Menu- by Ger Versluis (http://www.burmees.nl/)
//Submitted to Dynamic Drive (http://www.dynamicdrive.com)
//Visit http://www.dynamicdrive.com for this script and more

function Go(){return}

</script>
<script type='text/javascript' src='exmplmenu_var.js'></script>
<script type='text/javascript' src='menu_com.js'></script>
<noscript>Your browser does not support script</noscript>

Trying to get the javascript directly from LocalSettings allows the page to load, but also gives this (and doesn't get the menu):

Warning: Cannot modify header information - headers already sent by ([pathname was here]call_js.js:1) in [pathname]WebResponse.php on line 10

Anyway, if anyone who knows about wikis and would like to write an answer, I think it might be the only one on the web, and would help a lot of people besides me.
Mrtn is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-22-2008, 09:36 PM Re: installing a java menu on a wiki
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
Quote:
I know this is probably too basic a question
Any question is a good question, I'm sure there are lots of people who have dealt with the same issues. Now just to give a little background...

Javascript (not to be confused with Java) is client side code, meaning that it is downloaded as is and parsed by the user's browser. PHP is server side code meaning it is executed by the server and the output is sent to the client.

I don't think you really need to "call" your javascript from PHP, if I understand correctly what you should do is just insert your javascript as you would just plain html and then add in any php necissary to make it work. Example:

PHP Code:
<script type='text/javascript'>
var x = <?php echo $x ?>;
doSomething(x);
</script>
This example is trivial of course but I think what you are aiming for will look a little bit more like that. Instead of just linking to you js files you may have to write in the full script and then add whatever php you need (say if you are building a menu and each item is being pulled from a database).

Hope that helps.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Reply     « Reply to installing a java menu on a wiki
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.10549 seconds with 12 queries