How to use Javascript in PHP

Javascript in PHP

You can embody Javascript code in modules competently in PHP-Nuke. you'll be able to proceed in 2 ways:

Include your Javascript functions in javascript.php (Section twenty one.9.1).

Include your complete Javascript code within the module (Section twenty one.9.2)

 Javascript functions in javascript.php

PHP-Nuke go with its own Javascript functions enclosed within the file javascript.php, situated underneath the includes folder. you'll be able to add your own Javascript code there, if you follow some easy rules:

Use an honest text editor (see Chapter 11) to edit the file.

Append your code once the code already there, however before the ending ?> line.

“echo” every line of your Javascript script. Example: rather than getting into directly the script code:


function openwindow() 


enter it with “echo”s as:

echo "\n";
echo "<!--\n";
echo "function openwindow() echo "\"modules/$name/copyright.php\",\"Copyright\",
echo "">\n";
echo "//-->\n";
echo "\n\n";
Enclose every line in quote, sort of a string, and escape (with a backslash \) any double quote within that string.

Add a newline character (\n) to the string, before the closing double quote[1].

End every line, like each PHP line, with a punctuation mark (;).

Complete Javascript code in modules

You can use the subsequent guide to incorporate your complete Javascript code in your PHP-Nuke module:

if (!eregi("modules.php", $PHP_SELF)) cannot access this file directly...");
// zero : don't show right blocks - 1:show right blocks
$index = 0; 
// place markup language OR JAVASCRIPT CODE HERE, 
// OR GET obviate THE ?> AND <?php on top of AND BELOW THIS LINE 

List of Backlinks


Popular posts from this blog

How Outsourced Healthcare Services Leads to Improved Patient Experience?

BS6 compliant Ford EcoSport launched in India, price starts at Rs 8.04 lakhs

Best DoFollow profile creation sites list OCT 2019