Javascript/Jquery not being run. [Answered]

Forum
Last Post
Threads / Messages

exactly33

Member
Member
Joined
Dec 17, 2008
Messages
18
Points
0
Age
34
Mysidian Dollar
2,881
Although, meddling with HTML/PHP and Javascript for the past few years, I have never understood why they wouldn't execute on certain pages. Ones that seemed to be pre-rendered through php or some other process would never run the animated jquery actions. I have attempted to place a few fancy Jquery applications inside my page and was rather disappointed when none of them would render. Of course, the website isn't fully completed but I would like some help. :D

http://adopt.universe-9.com/

Problems:
The banner should scroll as if on a cylinder (the blue clouds).
The menu should have an image sliding back and forth behind the text.

Thanks in advance.
Justin
 
RE: Javascript/Jquery not being run.

I've uploaded the original template file, where the javascript is working.
http://adopt.universe-9.com/templates/default/original.html

Thanks again. :D
 
RE: Javascript/Jquery not being run.

exactly33 said:
I've uploaded the original template file, where the javascript is working.
http://adopt.universe-9.com/templates/default/original.html

Thanks again. :D

JS is normally iniciated in the <head></head> PHP pages don't have that area for the JS to be started. It is possible to use JS in php but is done in a bit different process to enable it.
 
RE: Javascript/Jquery not being run.

Right, dynamically loading it? How would I go about doing this? Would echoing work, so as to have it load on the front end?

Help? :p
 
RE: Javascript/Jquery not being run.

My pages have been greatly changed from the original script.. but this is an idea of how I have JS incorporated & where it is placed

PHP:
// Permissions
//**************************************************
// <editor-fold defaultstate="collapsed" desc="Permissions">
if ($isloggedin != 'yes') {
    $article_title = $accden . "<br /><br />";
    $article_content = $reqlogin;
    // **********************************************************************
    // Begin Template Definition
    // **********************************************************************
    //Define our current theme
    $file = $themeurl;
    // Do the template changes and echo the ready template
    $template = file_get_contents($file);
    $template = str_replace(':ARTICLETITLE:',$article_title,$template);
    $template = str_replace(':ARTICLECONTENT:',$article_content,$template);
    $template = str_replace(':BROWSERTITLE:',$browsertitle,$template);
    $template = str_replace(':SITENAME:',$sitename,$template);
    echo $template;
    return;
    // **********************************************************************
    // End Template Definition
    // **********************************************************************
}
// </editor-fold>
//**************************************************
// POST Info
//**************************************************
// <editor-fold defaultstate="collapsed" desc="POST Info">
$act = $_POST["act"];
$rmto = $_POST["rmto"];
$rmfrom = $_POST["rmfrom"];
$ids = $_POST["ids"];
$order = $_POST["order"];
// </editor-fold>
// **********************************************************************
// End Prepwork - Output the page to the user
// This file lets a user mass move their adoptables...
// **********************************************************************
$article_content = '<script type="text/javascript">
<!--
function SetAllCheckBoxes(FormName, CheckValue) {
    var myform = document.forms[FormName];
    for (var i = 0; i < myform.length; i++) {
        if (myform.elements[i].type == "checkbox") {
            if (CheckValue) {
                myform.elements[i].checked = CheckValue;
            } else {
                myform.elements[i].checked = "";
            }
        }
    }
}
// -->
</script>';
switch ($act) {
 
RE: Javascript/Jquery not being run.

Thanks so much for your help. :p

Of course, a noob solves his own questions. I realized that the actual template would be rendered in the root rather than in the template directory, thus effectively disallowing the template to actually load the external javascript. It couldn't find the resources. ^.^

Thanks anyways.
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,280
Messages
33,130
Members
1,603
Latest member
Monako
BETA

Latest Threads

Latest Posts

Top