473,326 Members | 2,337 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Can i call php file in Javascript file

Can i call php file in Javascript file,?
or
how can call php functions in javascript file ?

Please help me out here

Thanks,
Harsh
Feb 19 '08 #1
3 8380
harshmaul
490 Expert 256MB
Hi, and first off can i say I like your name!!!! I mean mine being harsh aswel!!!

secondly back to business, how do you want to call the PHP, research a bit of ajax, you can submit a form to php using javascript, but it really depends on what you are trying to do
Feb 19 '08 #2
I have pop up in php file. I have fade in - fade out functions in that PHP file aswell. Working fine.

But Now when i write this functions in .js file and call that file over in PHP file it still works fine.

Now the problem is::::: I want to call this .js file functions (for my pop up) to another function inside the .js file. But when i do that its not working.

I am using document.getElementById to get the pop up text from PHP file. I want to call this .js file functions (for my pop up) to another function inside the .js file. But when i do that its not working because when i use getElementByID .js file does not know where to find ID, which is in that PHP file. Remember i have already call the .js file in PHP file but it does not work.

So i thought the only way is to call PHP file in .js file

By the way my name is HARSH. In india it means JOY but Here in USA it means Cruel. But i am not cruel. My parents did not think that i will go to USA someday. Well i am not changing my name for this because i like it.

Thanks in advance...
Harsh
India
Feb 19 '08 #3
harshmaul
490 Expert 256MB
Hi again Harsh,
You will need to post some code.

but heres some provisional information....

PHP files are held on the server, they respond to requests from browsers usually with html markup. Javascript is on the client machine and then cannot interact directly with PHP.
you CAN get variables to javascript which can be used later on, on the client machine, but not the other way (well at least not without posting). please be careful not to fall in the trap of thinking variables can be passed two ways between javascript and PHP.

I repeat my first statement again, please post as much code as you can so we can get a better idea of what you are trying to do.

Finally, my name is Harjit, and in school people shortened that to Harj, and the one of my friends with a speach impediment couldn't say the "J" sound, as used to call me harsh, and it stuck, and i used it as a tag name when i used to DJ.
Feb 20 '08 #4

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

Similar topics

9
by: Martin Waller | last post by:
Hello, I've been playing with the idea of just how to use an ASP page to provide a remote function call. In an ideal world this would be a web service but how can you do it if restricted to ASP...
3
by: JoeK | last post by:
Hey all, I am automating a web page from Visual Foxpro. I can control all the textboxes, radio buttons, and command buttons using syntax such as: ...
7
by: priya.tweety | last post by:
How to call a js file from another js file?
4
by: abcd | last post by:
I am novice asp.net programmer. I have xyz.js file which has resuable functions. I have asp.net form abcd.aspx and the code behind file abcd.aspx.cs, I want to put a 'Help' button when clicked...
4
by: dennise9 | last post by:
My exeternal JS works fine when the call is placed in the page head or body. But if I call the same javascript from a (clicked) text link on the page, the script throws a JS error when it...
12
by: Iddo | last post by:
Hi, I am having a strange problem... I have an HTML file which has 2 script tags: 1) <script language="javascript" id="ABC" src="ABC.js" /> 2) <script id="general" language="javascript">...
6
by: pronerd | last post by:
Hi, I am trying to dynamically set an event handler across frames. I have no problems setting properties across frames doing something like parent.ToolMenuFrame.location.href =...
3
by: Angus | last post by:
I have a web page with a toolbar containing a Save button. The Save button can change contextually to be a Search button in some cases. Hence the button name searchsavechanges. The snippet of...
5
by: moni | last post by:
Hi.. I am trying to use javascript for google maps display. If I call the javascript function from my aspx file I use: <input type="text" id="addresstext" value="Huntington Avenue,...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.