Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 888603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:25:35+00:00 2026-05-15T13:25:35+00:00

hi have a php template that displays an html page. in it there is

  • 0

hi have a php template that displays an html page. in it there is a call to a js file that initializes some jquery plugins.

on the template i have this code:

(function($) { 

 $(document).ready(function(){
     var adlow = <?php echo $jSeblod->disparities_tick_lower->value ?>;
     var adhigh = <?php echo $jSeblod->disparities_tick_upper->value ?>;
     var adtickno = <?php echo $jSeblod->disparities_tick_divisions->value ?>;

    });
})(jQuery);

then on the init.js page i call adlow, adhigh and adtickno.
i get variable undefined errors.

the php is returning the correct values. but then the external init file is not getting them. do i need to do something special to get the init file to be able to use these variables?
all i did was just plug them in…

thanks, i am a little hazy on the interaction between these pages.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T13:25:36+00:00Added an answer on May 15, 2026 at 1:25 pm

    They need to be globals for other pages to use them. Try removing the var. Or namespace them, which is better practice:

    $(document).ready(function(){
        MYAPP = {};
        MYAPP.adlow = <?php echo $jSeblod->disparities_tick_lower->value ?>;
        MYAPP.adhigh = <?php echo $jSeblod->disparities_tick_upper->value ?>;
        MYAPP.adtickno = <?php echo $jSeblod->disparities_tick_divisions->value ?>;
    
       });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a index.php file that will include several external files: content/templates/id1/template.php content/templates/id2/template.php content/templates/id3/template.php
I have this code which will include template.php file from inside each of these
SOLVED: Error in template file I have Smarty setup like this: require_once 'smarty/Smarty.class.php'; $smarty
I have found in sfDoctrineApplyPlugin a template called applyAfter.php that shows a message like
I have the following code in my Drupal 7 template.php file: function mytheme_preprocess_views_view__videos__videos(&$vars) {
Hallo I have this script: <? require(lib2/config.inc.php); require(lib2/tpl.class.php); require(lib2/db.class.php); require(lib2/um.class.php); $tpl = new template(templates,
I have a simple page in a PHP/MySQL web application that lets admin users
I have a PHP built calendar that displays dates for each month. Now what
I have an archive page template that I've built that has a successful navigation
I'm trying to use a php function within a template html form that is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.