Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Questions and Supports (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=18)
-   -   Javascript/Jquery not being run. [Answered] (http://www.mysidiaadoptables.com/forum/showthread.php?t=1233)

exactly33 12-21-2009 03:24 AM

Javascript/Jquery not being run. [Answered]
 
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

exactly33 12-21-2009 12:35 PM

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

Seapyramid 12-21-2009 02:12 PM

RE: Javascript/Jquery not being run.
 
Quote:

Originally Posted by exactly33
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.

exactly33 12-22-2009 06:39 PM

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

Seapyramid 12-22-2009 09:01 PM

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 Code:

// 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) { 


exactly33 12-23-2009 11:39 AM

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.


All times are GMT -5. The time now is 03:41 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.