473,612 Members | 2,181 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to call function php($varible) into javascript withod ajax

1 New Member
how call function php($varible) into javascript withod ajax:

Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3. <!--
  4. this code only call funnctions php but
  5. how call function php[ function-name(varible)]
  6. intermanch@gmail.com
  7. www.intermanch.blogfa.com
  8. -->
  9.  
  10. <script>
  11. function Helloo($f)
  12. {
  13. var t4 = document.createElement('div');
  14. t4.innerHTML ="<?php hello() ?>";
  15. document.getElementById('dl').appendChild(t4);
  16. }
  17. </script>
  18.  
  19. <?php
  20. function hello()
  21. {
  22. //if on the java script can write function-name(varible) than can write echo varible;
  23. //echo $x;
  24. //help to complet this code
  25. echo "name: ";
  26. echo "<input><br>";
  27. echo "<a href='http://www.intermanch.blogfa.com'>view my weblog";
  28. //and all php cods even query from database 100% withod error
  29. }
  30. ?>
  31.  
  32. <body>
  33.  
  34. <input value='click me' type=button onclick="Helloo('200')">
  35. <div align=right  id=dl>
  36. </div>
  37. </body>
  38. </html> 
  39.  
Jul 2 '10 #1
1 3314
Dormilich
8,658 Recognized Expert Moderator Expert
if you want to call PHP from JavaScript, you have to use AJAX (simply due to the fact, that PHP and standard JS have different execution times).

but if there is no dynamic requirement, you can use PHP to create the appropriate JS code.
Jul 5 '10 #2

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

Similar topics

6
17595
by: Cathryn Lindner | last post by:
I am building a web application. On the form, I have a checkbox that needs to display a drop down list when checked. The drop down list is populated by a function in a dll that is registered in my project. How do I call this function in javascript? *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
1
3429
by: Sipho | last post by:
Hi, I need to instantiate a VB6 function and call it from javascript in ASP. <script language='javascript'> function onScheduleTask() { var ocuScheduler ocuScheduler = new ActiveXObject("CCUtility.CU_ScheduledTaskQueue")
4
35979
by: Steven | last post by:
Hello, How to call a C# function (eg., main()) from a Javascript funtion (eg., ref()). -- Steven
4
12410
by: KK | last post by:
Hi, Does anybody know how to call server side function in javascript? Suppose I've a method named Test() at code behind of ASP.Net page. How can I call that method in javascript function ??? Any help is appreciated..
1
1466
by: robbi.st | last post by:
hallo, da ich nicht so gut bin in dem, wollte ich mal fragen ob es möglich ist, ein popup via javascript in ajax aufzurufen. bis jetzt ist es mir zwar gelungen, ein popup aufzurufen, jedoch wurde die seite von der es aufgerufen worden ist auch verändert. das script sieht etwa so aus:
2
1425
by: praveen2gupta | last post by:
Hi I wants to make my application compatable with IE7, Its working fine in IE6. But there are a lot of errors while working with IE7. I am using JavaScript and Ajax a lot of places. I would Like to know the difference in these two versions of browser and how i should make it compatable for the both versions of IE.
1
1745
by: jerin | last post by:
Hi, I dont know "how to call a serverside function through javascript".When i tried to call the function like this: <%=FillAnmID() %> where FillAnmID is the server side function. I got a compilation error like this " Overload resolution failed because no accessible 'Write' can be called with these arguments". Is there any solution for it . plz inform me. I need it.
9
2042
by: TechnoAtif | last post by:
<form name=frm action="" method="post"> <table> <tr><td><select name=combo> <option>1</option> <option>2</option> <option>3</option> <option>4</option> </select> <td><input type="text" name=tb1 value=""></td> <td><input type="text" name=tb2 value=""></td>
0
8171
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8114
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
8615
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8253
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
8422
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7044
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4110
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2554
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
1
1699
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.