473,493 Members | 4,319 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

ajax/javascript multiple functions

2 New Member
I have a link in my webpage, that wants to call to functions at once.

Expand|Select|Wrap|Line Numbers
  1. <td onclick="createform(event,<?php echo $startdag;?>,<?php echo $maand;?>,<?php echo $jaar;?>);createpic(event,<?php echo $startdag;?>,<?php echo $maand;?>,<?php echo $jaar;?>);" class="calendaroff" onmouseover="this.className='calendarover';" onmouseout="this.className='calendaroff';">
Normale this has to work.
So there are 2 functions, createform and createpic.
This won't work, but when i put the createpic, after the onmouseout it will work, but that is not the way, because i only want to activate this function on a click.

I think it has to do with the ajax function send, but don't know, because i'm relatively new to this stuff.
Dec 30 '07 #1
3 1446
acoder
16,027 Recognized Expert Moderator MVP
Welcome to TSDN!

In createForm, do you have a return statement?
Dec 30 '07 #2
grezly
2 New Member
Cheers,

Sorry that i forgot to mention the 2 functions.

Expand|Select|Wrap|Line Numbers
  1. function createform (v_dag,v_maand,v_jaar) {
  2.  
  3. theObject = document.getElementById("pagecont");
  4. theObject.style.visibility = "visible";
  5. theObject.style.height = "80%";
  6. theObject.style.width = "80%";
  7. var objID = "pagecont";
  8. var serverPage = "create_story.php?dag="+v_dag+"&maand="+v_maand+"&jaar="+v_jaar;
  9. var obj = document.getElementById(objID);
  10.  
  11. http_verbinding.open("GET", serverPage);
  12. http_verbinding.onreadystatechange = function ()
  13. {
  14. if(http_verbinding.readyState == 4 && http_verbinding.status == 200)
  15. {
  16. obj.innerHTML = http_verbinding.responseText;
  17. }
  18. }
  19. http_verbinding.send(null);
  20.  
  21. }
  22.  
  23. function createpic (v_dag,v_maand,v_jaar) {
  24.  
  25. theObject = document.getElementById("picturescont");
  26. theObject.style.visibility = "visible";
  27. theObject.style.height = "80%";
  28. theObject.style.width = "80%";
  29.  
  30. var objID = "picturescont";
  31. var serverPage = "pictures.php?dag="+v_dag+"&maand="+v_maand+"&jaar="+v_jaar;
  32. var obj = document.getElementById(objID);
  33.  
  34. http_verbinding.open("GET", serverPage);
  35. http_verbinding.onreadystatechange = function ()
  36. {
  37. if(http_verbinding.readyState == 4 && http_verbinding.status == 200)
  38. {
  39. obj.innerHTML = http_verbinding.responseText;
  40. }
  41. }
  42. http_verbinding.send(null);
  43.  
  44. }
Like it is shown above, the functions are almost identical.
There is no return statement in it.
Dec 30 '07 #3
gits
5,390 Recognized Expert Moderator Expert
hi ...

i guess you use a global http_verbinding-object? ... you overwrite it with the second function so you could use a local HTTPRequestObject in either function to solve this ...

kind regards
Dec 31 '07 #4

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

Similar topics

3
5875
by: petermichaux | last post by:
Hi, I am trying to put together the last major pieces of my project's puzzle. This is more website/client-side architecture than JavaScript syntax but I hope this is a good place to ask. I'm a...
17
3264
by: Chaprasi | last post by:
Hi I need help with prototype while doing ajax calls. So this is my JS which does a ajax calls var ajax1 = new Ajax.Request ( url, { method: 'get', parameters: params, onComplete:...
31
3070
by: Tony | last post by:
I just noticed that prototype.js is one of the files in the Ajax.NET distribution - I'm pretty concerned about this. Does anyone know if this is the same "prototype.js" that is not well-liked...
3
1716
by: OJ | last post by:
Hi, I have written a small C# 2.0 DLL which acts as a client to a Socket based server over the internet. I have written both synchronous and asynchronous methods to connect, send, and receive data...
4
3817
by: Nathan Sokalski | last post by:
I am a beginner with AJAX, and have managed to learn how to use it when passing single parameters, but I want to return more than one value to the client-side JavaScript function that displays it....
10
4820
by: trpost | last post by:
I am using ajax / php where I am looking up some info from the database and populating a select list dynamically, however I am running into some sort of size limitation with the ajax.response...
1
4011
by: geevaa | last post by:
http://www.phpbuilder.com/columns/kassemi20050606.php3 XMLHttpRequest and AJAX for PHP programmers James Kassemi Introduction: Although the concept isn't entirely new, XMLHttpRequest...
6
2509
by: Nico VanHaaster | last post by:
Hello all, I have run across an issue with IE 6.0+. I have a page that makes an XMLHttpRequest to the webserver to update a report on the page. The first time you hit the refresh report button...
17
11835
by: Arjen | last post by:
Hi, I want to reload 2 divs at one click. Ive tried: <a href = "javascript:void(0);"...
2
3120
by: shivendravikramsingh | last post by:
hi friends, i m using a ajax function for retrieving some values from a database table,and display the values in required field,my prob is that the ajax function i m using is working f9 once,but if...
0
7118
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
6980
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
7192
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
7364
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
5452
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,...
1
4886
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
4579
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
3087
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...
0
1397
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 ...

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.