473,409 Members | 2,022 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,409 software developers and data experts.

how can I load one php file in div when I click a button which is in another file div

i use this jquery in order to load the another file.and also for implementing jquery we need to include something else other than jquery.js...
Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript" src="jquery.js"></script>
  2. <script type="text/javascript">
  3. $(document).ready(function(){
  4.   $("#button").click(function(){
  5.     $("#sem_content_right").slideToggle();
  6.     $("#two").load('chief_input_form.php');
  7.   });
  8. });
  9.  
and my html part is
Expand|Select|Wrap|Line Numbers
  1. <div id="sem_con_wrapper">
  2. <div id="sem_content_left">
  3. <?php include("sem_input_form.php"); 
  4. ?>
  5. </div>
  6. <div id="sem_content_right">
  7. <?php include("chief_input_form.php");
  8. ?>
  9. <input type="button" value="ONE MORE" id="buttton" />
  10. </div>
  11. <div id="two" style="background-color:#066; height:500px; width:330px;>
  12. </div>
  13.  
  14.  
  15.  
  16.  
May 22 '12 #1
7 3364
Dormilich
8,658 Expert Mod 8TB
how can i load one php file in div when i click a button which is in another file div
why should that matter? you have a button, you attach an event handler to it, that handler inserts code somewhere. I don’t see a conflict between <div>s anywhere.
May 22 '12 #2
I use some function like when the document is load it have to call some other function.. when i remove that function the above coding is works.. is it any problem in that
Expand|Select|Wrap|Line Numbers
  1. window.onload=start();
In start(); i have to call some other function like that my coding proceed.
May 23 '12 #3
Dormilich
8,658 Expert Mod 8TB
a) window.onload = start(); immediately executes the function and does not wait for the load event

b) yes, a second window.onload would overwrite the first one. use Event Listeners (addEventListener()) to circumvent that.
May 23 '12 #4
thanks, the coding works.but i didnt use addEventListener().what is the purpose of this.
May 23 '12 #5
Dormilich
8,658 Expert Mod 8TB
allowing more than one handler for an event.
May 23 '12 #6
is this is a format for the addEventListener()...
Expand|Select|Wrap|Line Numbers
  1. function func1() {
  2.   alert("This is the first.");
  3. }
  4. function func2() {
  5.   alert("This is the second.");
  6. }
  7.  
  8. function addLoadEvent(func) {
  9.   var oldonload = window.onload;
  10.   if (typeof window.onload != 'function') {
  11.     window.onload = func;
  12.   } else {
  13.     window.onload = function() {
  14.       if (oldonload) {
  15.         oldonload();
  16.       }
  17.       func();
  18.     }
  19.   }
  20. }
  21. addLoadEvent(func1);
  22. addLoadEvent(func2);
  23. addLoadEvent(function() {
  24.     document.body.style.backgroundColor = '#EFDF95';
  25. })
  26.  
May 23 '12 #7
Dormilich
8,658 Expert Mod 8TB
hm, yea. a complicated way of expressing 3 lines of code without full support of the event flow (no event capturing possible) or even the usability of the Event object or the this keyword.

and if I (or another script) do window.onload = func3; all previous assignments are lost.
May 23 '12 #8

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

Similar topics

2
by: yatharth | last post by:
I am facing a problem ,the situation is like this. I have a home page named "Index.html" ,on which there is login link,when i click on the login link the login popup opens and user enter the...
9
by: Justme | last post by:
Novice programmer needs help with using fgets to read and ignore the first two lines of a file. I've gone thru the previous posting regarding fgets, but none of them seems to help my situation. I...
1
by: nasir872 | last post by:
how to read from a csv or text file and write in another file ? please help. i need a working code example. thanks
5
by: skyy | last post by:
Hi.. I am trying to create a perl-cgi script to make a upload page such that when the user select a file using the "Browse" button, the filename will appear on another textbox. i understand...
3
by: xiaowei | last post by:
I m using Access 2003. Is this possible and how? Thank you. Xiaowei
2
by: mostafijur | last post by:
Hello 1. A program writing some data line by line in a file every 1 second. Data is writing like: 1 30 2 44 3 45 ...
2
by: masha2011 | last post by:
Hello all, I am very new to programming and I have recently started using python. I am interested in creating a file to essentially compare data points. I am curious if it is possible to read...
0
by: abdulazees | last post by:
when click button i want to print autometicaly reportveiwer data, i not need to show reportviewer.
1
by: elriez | last post by:
hye all currently im doing a project that need to include the sound..i already include the sound by simply import to the library and drag it to the stage..the sound can play well..the problem...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
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...
0
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
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...

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.