ajax - Add 3 variable to Javascript-Code -


maybe kind me? because don't have knowledge in ajax / javascript!.

i have onclick-event , need modify it. @ moment changes "aboutme" section. want modify it!

before:

onclick="loadcontent();" 

what want

onclick="loadcontent('aboutme', '0', '0');" 

function loadcontent() {     xmlhttpobject.open('post','_files/ajax/aboutme.php');     xmlhttpobject.onreadystatechange = upadatecontent;     xmlhttpobject.send(null);     return false; }  function upadatecontent() {if (xmlhttpobject.readystate == 4) {   document.getelementbyid('aboutme').innerhtml = xmlhttpobject.responsetext; }} 

what cant work:

  1. is correct? how filled variables "onclick" event?

  2. inside "loadcontent" want load file based on variables =

    _files/ajax/(aboutme).php?var1=(0)&var2=(0)

  3. next step: (also in "loadcontent" function) need submit first variable (aboutme) next "upadatecontent" function.

  4. last step: use (aboutme) variable in upadatecontent function =

    document.getelementbyid('aboutme').innerhtml

.... really hope can maybe me!

mh... try - hope correct? , thy link!

onclick="loadcontent("aboutme", "fl", "05082015");"  function loadcontent(v1, v2, v3)     {     var content = v1;     var city = v2;     var date = v2;      xmlhttpobject.open('post','_files/ajax/.content.php?var1=.city.&var2=.date');     xmlhttpobject.onreadystatechange = upadatecontent(content);     xmlhttpobject.send(null);     return false; }  function upadatecontent(s1) {if (xmlhttpobject.readystate == 4) {   changecontent = s1;      document.getelementbyid('.changecontent.').innerhtml = xmlhttpobject.responsetext; }} 

Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -