| |

VerySource

 Forgot password?
 Register
Search
View: 614|Reply: 2

`Unresolved problems during learning, look at passing` Thank you

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-23 15:40:01
| Show all posts |Read mode
It probably means that I want to do something with Ajax!
I returned a Hashtable to the foreground in the background! Then what do I do with javascript to get the values ​​inside! ''
Now only the data of type string or int returned by the background will be processed! But the need to return needs to be a set of data! I don't know what to use to return `` ``, and I don't know what to do with javascript in the front desk!

Maybe it should be XML`! But I don't know how to get it!
Who knows if you have trouble making a paste code!
Reply

Use magic Report

0

Threads

29

Posts

23.00

Credits

Newbie

Rank: 1

Credits
23.00

 China

Post time: 2020-3-9 15:15:01
| Show all posts
function load ()
{
   var xmlhttp = new ActiveXObject ("Microsoft.XMLHTTP"); // Create XMLHTTPRequest object, need MSXML4.0 support
   xmlhttp.open ("POST", "../../ AddressBehind.aspx", false, "", ""); // Initiate HTTP request using HTTP GET
   xmlhttp.setRequestHeader ("Content-Type", "application / x-www-form-urlencoded");
    xmlhttp.send ("name = ddlPro&id = 1"); // Send HTTP request and get HTTP response

    var res = xmlhttp.responseText.split ("| *");

    var name = res [0] .split ("|");

    var id = res [1] .split ("|");

   document.all.ddlPro.options [0] = new Option ("Please select", 0);
   document.all.ddlCity.options [0] = new Option ("Please select", 0);
   document.all.ddlReg.options [0] = new Option ("Please select", 0);
   for (i = 0; i <name.length; i ++)
   {
    document.all.ddlPro.options [i + 1] = new Option (name [i], id [i]);
   }
   

    xmlhttp.open ("POST", "../../ Sort.aspx", false, "", ""); // Initiate HTTP request using HTTP GET
    xmlhttp.setRequestHeader ("Content-Type", "application / x-www-form-urlencoded");
    xmlhttp.send (); // Send HTTP request and get HTTP response
    var res = xmlhttp.responseText.split ("|");
    document.getElementById ("dish"). innerHTML = res [1];
    var dishImage = document.getElementById ("dishImage");
    dishImage.src = "../../ image /" + res [0];
    xmlhttp.open ("POST", "../../ RestSort.aspx", false, "", ""); // Initiate HTTP request using HTTP GET
    xmlhttp.setRequestHeader ("Content-Type", "application / x-www-form-urlencoded");
    xmlhttp.send (); // Send HTTP request and get HTTP response
    
    res = xmlhttp.responseText.split ("|");
    document.getElementById ("rest"). innerHTML = res [1];
    var restImage = document.getElementById ("restImage");
    restImage.src = "../../ image /" + res [0];
    }
Reply

Use magic Report

1

Threads

8

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-3-10 23:00:02
| Show all posts
Learn
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list