473,503 Members | 1,692 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HELP: returned php value as a javascript function parameter

1 New Member
Hello Friends,

I'm working on a project which involves JavaScript and PHP and I'm really stuck.

I have a php file which returns a string (myPHPfile.php)

I would like to use this string as a parameter in one of my javascript function (myFunction(string)).

Expand|Select|Wrap|Line Numbers
  1. <body onload="load(); myFunction(myPHPfile.php);" >
But I don't know how to run myPHPfile within the code and recieve the value so that myFunction would run later.

Or perhaps I'm looking for a general answer of how to capture a value from PHP and use it in a JavaScript function as a parameter.

Thank you in advance.
Jan 7 '08 #1
1 1208
r035198x
13,262 MVP
Hello Friends,

I'm working on a project which involves JavaScript and PHP and I'm really stuck.

I have a php file which returns a string (myPHPfile.php)

I would like to use this string as a parameter in one of my javascript function (myFunction(string)).

Expand|Select|Wrap|Line Numbers
  1. <body onload="load(); myFunction(myPHPfile.php);" >
But I don't know how to run myPHPfile within the code and recieve the value so that myFunction would run later.

Or perhaps I'm looking for a general answer of how to capture a value from PHP and use it in a JavaScript function as a parameter.

Thank you in advance.
Javascript runs on the client side while PHP runs on the server. To get a PHP result to your Javascript function you can use AJAX.
Jan 7 '08 #2

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

Similar topics

7
2361
by: Alan Bashy | last post by:
Please, guys, In need help with this. It is due in the next week. Please, help me to implement the functions in this programm especially the first three constructor. I need them guys. Please, help...
8
5451
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
5
2348
by: Notgiven | last post by:
Both of the following code smippets work in IE but not in Firefox. The javascript error for both scripts below is "x has not properties". The select boxes are shown as arrays since they are...
9
2340
by: santosh | last post by:
Hello all, I've put together a small program to count the number of characters and 'words' in a text file. The minimum length of a word, (in terms of no. of characters), as well as word...
15
2551
by: Jay | last post by:
I have a multi threaded VB.NET application (4 threads) that I use to send text messages to many, many employees via system.timer at a 5 second interval. Basically, I look in a SQL table (queue) to...
0
5518
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
2
3135
by: sorobor | last post by:
dear sir .. i am using cakephp freamwork ..By the way i m begener in php and javascript .. My probs r bellow I made a javascript calender ..there is a close button ..when i press close button...
7
2341
by: gubbachchi | last post by:
Hi all, In my application I need to display the data fetched from mysql database after the user selects date from javascript calender. I have written the code in which after the user selects the...
2
1972
Dormilich
by: Dormilich | last post by:
Hi, I'm testing my classes for a web page and I stumble upon an error I don't have a clue what it means: Error: Fatal error: Can't use method return value in write context in "output.php" on...
0
7199
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7273
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7322
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...
0
7451
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5000
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4667
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...
0
3161
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...
1
731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
374
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...

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.