Jump to content

"javascript" not working on website [SOLVED]


James142

Recommended Posts

Hello guys,

I got a new template for my va and it has a image slider on the top (using javescript). It works fine in html coding but when i switch it to .tpl coding, the slider does not work. I have set all the folders into the right place but have no idea why it wont work.

Any ideas will be much appreciated,

James

Link to comment
Share on other sites

  • Moderators

let's look in the layout.tpl or header.tpl

<title><?php echo $page_title; ?></title>

<link rel="stylesheet" media="all" type="text/css" href="<?php echo SITE_URL?>/lib/skins/crystal/styles.css" />

<?php 
/* This is required, so phpVMS can output the necessary libraries it needs */
echo $page_htmlhead; 
?>

<?php /*Any custom Javascript should be placed below this line, after the above call */ ?>



</head>
<body>
<?php
/* This should be the first thing you place after a <body> tag
This is also required by phpVMS */
echo $page_htmlreq;
?>

You see where it says you place the JS after the call of

echo $page_htmlhead; 

To call for the JS

It works like this

<script type="text/javascript" src="<?php echo SITE_URL?>/lib/skins/someskin/script.js"></script>

So here's our result


<title><?php echo $page_title; ?></title>

<link rel="stylesheet" media="all" type="text/css" href="<?php echo SITE_URL?>/lib/skins/crystal/styles.css" />

<?php 
/* This is required, so phpVMS can output the necessary libraries it needs */
echo $page_htmlhead; 
?>

<?php /*Any custom Javascript should be placed below this line, after the above call */ ?>

<script type="text/javascript" src="<?php echo SITE_URL?>/lib/skins/someskin/script.js"></script>

</head>
<body>
<?php
/* This should be the first thing you place after a <body> tag
       This is also required by phpVMS */
echo $page_htmlreq;
?>

And you should be good to go.

Also one more thing, if you have more than one JS, then you will have to change which JS is first or is second as in order for the adding bid schedules or another phpVMS based JS.

If any more problems, let me know.

Link to comment
Share on other sites

let's look in the layout.tpl or header.tpl

<title><?php echo $page_title; ?></title>

<link rel="stylesheet" media="all" type="text/css" href="<?php echo SITE_URL?>/lib/skins/crystal/styles.css" />

<?php 
/* This is required, so phpVMS can output the necessary libraries it needs */
echo $page_htmlhead; 
?>

<?php /*Any custom Javascript should be placed below this line, after the above call */ ?>



</head>
<body>
<?php
/* This should be the first thing you place after a <body> tag
This is also required by phpVMS */
echo $page_htmlreq;
?>

You see where it says you place the JS after the call of

echo $page_htmlhead; 

To call for the JS

It works like this

<script type="text/javascript" src="<?php echo SITE_URL?>/lib/skins/someskin/script.js"></script>

So here's our result


<title><?php echo $page_title; ?></title>

<link rel="stylesheet" media="all" type="text/css" href="<?php echo SITE_URL?>/lib/skins/crystal/styles.css" />

<?php 
/* This is required, so phpVMS can output the necessary libraries it needs */
echo $page_htmlhead; 
?>

<?php /*Any custom Javascript should be placed below this line, after the above call */ ?>

<script type="text/javascript" src="<?php echo SITE_URL?>/lib/skins/someskin/script.js"></script>

</head>
<body>
<?php
/* This should be the first thing you place after a <body> tag
       This is also required by phpVMS */
echo $page_htmlreq;
?>

And you should be good to go.

Also one more thing, if you have more than one JS, then you will have to change which JS is first or is second as in order for the adding bid schedules or another phpVMS based JS.

If any more problems, let me know.

Thank you so much! But I have realised that the ACARS map does not show up on my site? woud this have ot do with the custom javascript like you where saying? (http://www.flyirelandva.com/index.php/acars) or is this a different problem?

Thanks,

James

Link to comment
Share on other sites

  • Moderators

Yeah, I can tell it has to do with JS, becasue you said you are using the js for image slider, so that's the issue.

But one thing, how many JS you have. One or more?

I just noticed with my firebg that you have a lot of JS errors. So it looks like you have more than one JS, is that correct?

Link to comment
Share on other sites

Yeah, I can tell it has to do with JS, becasue you said you are using the js for image slider, so that's the issue.

But one thing, how many JS you have. One or more?

I just noticed with my firebg that you have a lot of JS errors. So it looks like you have more than one JS, is that correct?

yeah there is quite alot of them :S I have never used javascirpt before so I dont know anything about it. I have also noticed that most of the site is not working with this template because of the javascript.

Ill post the top half of the layout.tpl below..

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "[url="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd[/url]">
<html xmlns="[url="http://www.w3.org/1999/xhtml"]http://www.w3.org/1999/xhtml[/url]">
<head><LINK rel="shortcut icon" href="[url="http://www.flyirelandva.com/images/icon/favicon.ico"]http://www.flyirelandva.com/images/icon/favicon.ico[/url]">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="author" content="FlyIreland Virtual" />
<meta name="description" content="FlyIreland Virtual was set up in late August 2010. We follow Ryanair and Aer Lingus. We offer our pilots a private teamspeak 3 server, pilot system, routes, aircraft and much more. For the users of fsx, fs2002. fs2004, x-plane" />
<meta name="keywords" content="flyirelandva, flyireland va, flyireland virtual, fsx, fs2004, wesite, flight simulation, ryanair, aer lingus, phpvms, pilot system, virtual airline, va, .com, ireland, fly , kacars, aircraft, a320, 737, a330, atr, 72, 42, a321, airbus, boeing, simulation, entertinment porposes only," />
<title><?php echo $page_title; ?></title>




<!-- Style sheets -->
<link rel="stylesheet" type="text/css" href="[url="http://www.flyirelandva.com/lib/skins/template/css/reset.min.css"]http://www.flyirelandva.com/lib/skins/template/css/reset.min.css[/url]" />
<link rel="stylesheet" type="text/css" href="[url="http://www.flyirelandva.com/lib/skins/template/css/menu.min.css"]http://www.flyirelandva.com/lib/skins/template/css/menu.min.css[/url]" />
<link rel="stylesheet" type="text/css" href="[url="http://www.flyirelandva.com/lib/skins/template/css/fancybox.css"]http://www.flyirelandva.com/lib/skins/template/css/fancybox.css[/url]" />
<link rel="stylesheet" type="text/css" href="[url="http://www.flyirelandva.com/lib/skins/template/css/tooltip.min.css"]http://www.flyirelandva.com/lib/skins/template/css/tooltip.min.css[/url]" />
<link rel="stylesheet" type="text/css" href="[url="http://www.flyirelandva.com/lib/skins/template/css/default.css"]http://www.flyirelandva.com/lib/skins/template/css/default.css[/url]" />


<?php /*Any custom Javascript should be placed below this line, after the above call */ ?>

<!-- jQuery framework and utilities -->
<script type="text/javascript" src="js/jquery-1.4.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.7.2.min.js"></script>
<script type="text/javascript" src="js/jquery.easing.1.3.min.js"></script>
<script type="text/javascript" src="js/hoverIntent.min.js"></script>
<script type="text/javascript" src="js/jquery.bgiframe.min.js"></script>
<!-- Drop down menus -->
<script type="text/javascript" src="js/superfish.min.js"></script>
<script type="text/javascript" src="js/supersubs.min.js"></script>
<!-- Tooltips -->
<script type="text/javascript" src="js/jquery.cluetip.min.js"></script>
<!-- Input labels -->
<script type="text/javascript" src="js/jquery.overlabel.min.js"></script>
<!-- Anchor tag scrolling effects -->
<script type="text/javascript" src="js/jquery.scrollTo-min.js"></script>
<script type="text/javascript" src="js/jquery.localscroll-min.js"></script>
<!-- Inline popups/modal windows -->
<script type="text/javascript" src="js/jquery.fancybox-1.2.6.pack.js"></script>

<!-- Slide shows -->
 <!-- Cycle  (default) -->
 <script type="text/javascript" src="js/jquery.cycle.all.min.js"></script>
 <script type="text/javascript">
  // initialize slideshow (Cycle)
  $(document).ready(function() {
   if ($('#Slides').length > 0) {
    $('#Slides').cycle({ 
     fx: 'scrollHorz',
     speed: 750,
     timeout: 6000, 
     randomizeEffects: false, 
     easing: 'easeOutCubic',
     next:   '.slideNext', 
     prev:   '.slidePrev',
     pager:  '#slidePager',
     cleartypeNoBg: true
    });
   }
  });
 </script>

<!-- Font replacement (cufè´¸n) -->
<script src="js/cufon-yui.js" type="text/javascript"></script>
<script src="js/LiberationSans.font.js" type="text/javascript"></script>

<!-- IE only includes (PNG Fix and other things for sucky browsers -->

<!--[if lt IE 7]>
 <link rel="stylesheet" type="text/css" href="css/ie-only.css">
 <script type="text/javascript" src="js/pngFix.min.js"></script>
 <script type="text/javascript"> 
  $(document).ready(function(){ 
   $(document.body).supersleight();
  }); 
 </script> 
<![endif]-->
<!--[if IE]> <link rel="stylesheet" type="text/css" href="css/ie-only-all-versions.css"><![endif]-->



<!-- BEGIN: For Demo Only -->
 <!--   
 These entries are only needed for demo features, such as the real-time skin changer.
 They can be deleted for production installs without effecting the theme's design or 
 any of the funcionality.
 -->
 <script type="text/javascript" src="js/demo.js"></script> 
 <link rel="stylesheet" type="text/css" href="css/demo.css" />
<!-- END: For Demo Only -->


<!-- Functions to initialize after page load -->
<script type="text/javascript" src="js/onLoad.min.js"></script>


</head>
<body>
<script type="text/javascript">validateLoad();</script>

<!-- Top reveal (slides open, add class "topReveal" to links for open/close toggle ) -->
<div id="ContentPanel">

<!-- close button -->
<a href="#" class="topReveal closeBtn">Close</a>

<div class="contentArea">

 <!-- New member registration -->

 <!-- Alternate Login -->    
 <div>

 </div>

 <!-- End of Content -->
 <div class="clear"></div>

</div>
</div>  

Thank you for the help!,

james

Link to comment
Share on other sites

  • Moderators

But one thing, maybe change the order of it. Like for what is the first JS on top of your website, and see what does. If it does not work, then I'll still have to pass it to the skin experts.

Sorry, but I did my best to help you out.

Link to comment
Share on other sites

Remove these two:

<script type="text/javascript" src="js/jquery-1.4.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.7.2.min.js"></script>

You're calling jQuery in again

Hi nabeel,

I removed the

<script type="text/javascript" src="js/jquery-1.4.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.7.2.min.js"></script>

like you said but the slider on the header has stopped working and the flight search ect.. is still not working?

Do you know if there is anything else i can do?

I kind of regret getting the javascript stuff on the template now but i dont think the site looks wight without it :S

Thanks, james

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...