473,395 Members | 1,885 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,395 software developers and data experts.

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

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 3303
Dormilich
8,658 Expert Mod 8TB
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
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...
1
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...
4
by: Steven | last post by:
Hello, How to call a C# function (eg., main()) from a Javascript funtion (eg., ref()). -- Steven
4
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 ???...
1
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...
2
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...
1
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...
9
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"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...
0
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...
0
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...

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.