473,657 Members | 2,523 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to use php variable in .js file

1 New Member
plz help

I have a php variable $content on page menu.php
now i wnt to use its value on page menu_items.js

hear menu_items.js create a menubar.its contan both static and dynamic menu

my lase menu as vander is dynamic now how can i use this variable on .js

my js file look like

['OUTDOOR LIVING', 'http://www.designresou rcestlouis.com/outdoorliving/index.php', null,
['Landscaping', 'http://www.designresou rcestlouis.com/outdoorliving/landscaping.php '],
['Pool & Fence', 'http://www.designresou rcestlouis.com/outdoorliving/poolfence.php'],
['Hot Tubs', 'http://www.designresou rcestlouis.com/outdoorliving/hottubs.php'],
['Decks & Patios', 'http://www.designresou rcestlouis.com/outdoorliving/deckspatios.php '],
['Outdoor Furniture', 'http://www.designresou rcestlouis.com/outdoorliving/furniture.php'],
['Kitchens & Living Spaces', 'http://www.designresou rcestlouis.com/outdoorliving/kitchensliving. php'],
['Sunrooms & Porches', 'http://www.designresou rcestlouis.com/outdoorliving/sunrooms.php']
],
['VENDORS', 'http://www.designresou rcestlouis.com/vendors/category.php', null,

in this space i want my variable value
],

my variable contain value
['1', '../subcategory.php ?id=14', null,['111', '../listing.php?id= 1', null,],['13', '../listing.php?id= 3', null,],['14', '../listing.php?id= 4', null,],['fegvrbt5 bh', '../listing.php?id= 5', null,],],['2', '../subcategory.php ?id=15', null,['111', '../listing.php?id= 1', null,],['14', '../listing.php?id= 4', null,],],['3', '../subcategory.php ?id=16', null,['111', '../listing.php?id= 1', null,],['12', '../listing.php?id= 2', null,],['13', '../listing.php?id= 3', null,],['14', '../listing.php?id= 4', null,],],['aa', '../subcategory.php ?id=17', null,[';..,/,Ltytryrty', '../listing.php?id= 6', null,],],['ankur', '../subcategory.php ?id=18', null,['fegvrbt5 bh', '../listing.php?id= 5', null,],],['test', '../subcategory.php ?id=20', null,[';..,/,Ltytryrty', '../listing.php?id= 6', null,],],['tgrhth', '../subcategory.php ?id=19', null,['111', '../listing.php?id= 1', null,],],
May 9 '07 #1
1 3460
Motoma
3,237 Recognized Expert Specialist
You can do this by having your .js file be a .php file instead. Then when you include it, you can drop your PHP variables in and everything should work fine.
May 9 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
7112
by: Dan Elliott | last post by:
Hello, Converting from a working C program to C++, I run into the following error: I have a header: (header.h) namespace shared{ ... struct X{ ...
10
1693
by: Altman | last post by:
I have only done a little programming in C++ so I am still learning but I am having a problem with a variable that is changing on me. I have tried this 2 ways with the same result. I have a private long variable that keeps changing for no reason. I have a trace file running to tell me what is going on. Here is kind of what is happening l_myVariable send l_myVariable out to tracefile Call a method send l_myVariable out to tracefile
7
2162
by: Greg Collins [MVP] | last post by:
Hi, I couldn't find what I was looking for by searching the newsgroup, but perhaps these have already been discussed somewhere. This is a bit long with a lot of interrelated questions. What I've got is a decodeImage.aspx page that gets called to decode base64 encoded images and return them as displayable images to a Web page. The ASPX page is passed two parameters, "file" and "img". The "file" parameter specifies and XML file on the Web...
4
2557
by: thomasp | last post by:
In the code below I have a function that tests if a file exists. It takes a variable named strFileName, simple enough. My question is, is there a way to pass it a variable with another name as long as the variable is a string? In different subs the variable of the file name may have a different name. An example would be the subOpenFile listed below. I have two files that I want to test with the function: strFileName and strFileName2. I...
6
8337
by: shaun | last post by:
If I put (define) const variables at the top of a .cpp file but do not declare them in the .h file, are they only visible within that .cpp file? e.g. const int a={1,2,3,4}; in a cpp file will be a 'global' with file scope? (no flames for oxymoron, please), available for use inside my functions which are defined in the same file (but which are also declared in the .h)?
2
2335
by: simon | last post by:
hello, what i'm looking to do is store the path of the app on a the server for reuse in the site. my thoughts so far are... -make a key in the web.config file -retrieve the value in globals.asax in application startup -store it in a variable that can be reference from all pages -use that variable on many pages my questions 1) what is the syntax of the lines in global.asax page to put this
2
2109
by: paladin.rithe | last post by:
I have no clue if this can be done, but I thought I'd ask anyway. I have a modular system where I store module information in a database. One of the types of modules that I have is one that, depending on the file, could have a different variable name in each file. I have named the module, and want to name it according to the name of the variable (ie, modulename Joe, var $Joe) Now, this variable needs to be loaded into a function, but...
13
1842
by: GGawaran | last post by:
First off, Hi everyone new to .asp and am trying to self teach myself. Im trying to figure out what exactly im doing wrong, or maybe what I think I can do, I really cant. The Idea. ------------------- On our website, we have several pieces of code we entered in so in the event that when you click on the category section, and "Engraving" was selected, it would load an include file and show our engraving options, etc. Well, I figured, we...
112
5423
by: istillshine | last post by:
When I control if I print messages, I usually use a global variable "int silent". When I set "-silent" flag in my command line parameters, I set silent = 1 in my main.c. I have many functions that may print some messages. foo(...) { if (!silent)
11
8310
by: Jef Driesen | last post by:
I have the following problem in a C project (but that also needs to compile with a C++ compiler). I'm using a virtual function table, that looks like this in the header file: typedef struct device_t { const device_backend_t *backend; ... } device_t; typedef struct device_backend_t {
0
8305
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8726
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4151
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4301
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1944
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1604
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.