请求有关同步JavaScript的帮助 [英] Request for help with Synchronous JavaScript

查看:70
本文介绍了请求有关同步JavaScript的帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好Sandip,

我在此网站上找到了有关使用可脚本化XML Webservice进行同步JavaScript调用的文章.我参考了您的以下代码

Hi Sandip,

I found your article on this website regarding Synchronous JavaScript call using Scriptable XML Webservice. I reffer your following code

function HelloMe() {
        var result = GetSynchronousJSONResponse('<%= Page.ResolveUrl("~/WebService.asmx/HelloMe") %>', '{"Name":"' + document.getElementById('txtName').value + '"}');
        result = eval('(' + result + ')');
        alert(result.d);
    }



但是我想将多个参数传递给Page.ResolveUrl函数,例如Name,City,State.

请帮帮我

谢谢,
Sandip B. Patel



but I want to pass multiple arguments to Page.ResolveUrl function like Name, City, State.

Please help me

Thanks,
Sandip B. Patel

推荐答案

好吧,我认为他正在尝试使用GetSynchronousJSONResponse()方法以JSON 格式发送多个参数,仅此而已.

如果是这种情况,那么请看下面的内容.我添加了另一个参数(状态).您可以按照此步骤添加更多参数.

Well, I think he is trying to send multiple parameters in JSON format in the GetSynchronousJSONResponse() method, that''s all.

If this is the case, then, take a look at below. I''ve added another parameter (State). You can follow this to add more parameters.

function HelloMe() 
{
           var result = GetSynchronousJSONResponse('<%= Page.ResolveUrl("~/WebService.asmx/HelloMe") %>', '{"Name":"' + document.getElementById('txtName').value + '","State":"' + document.getElementById('txtState').value + '"}');
           result = eval('(' + result + ')');
           alert(result.d);
}



祝您好运.



Best of luck.


文章作者不太可能会访问此页面并看到您的问题.

文章下方有一个讨论论坛.您可以在那里提出您的问题.文章作者会收到有关该消息的通知,因此您可以期待他(或其他文章读者)的答复.
It''s quite unlikely that the article writer will visit this page and see your question.

There is discussion forum below the article. You can put up your question there. The article writer gets notified about the messages there and so you can expect a reply from him (or the other article readers).


帕特尔.一些建议

1-尝试使用有意义的主题.您认为在此发布信息的人不要求帮助吗?
2-如果您要回复文章,则文章下方有一个论坛
3-如果您要回复先前的帖子,请回复该帖子

在2和3两种情况下,都可以使该站点上的一切井井有条,并向您尝试与之交谈的人发送电子邮件.

最可能的答案是,您需要连接您的值,然后在另一端解析它们.如果要传递URL,则可以在其中放置任意数量的查询字符串参数.我相信您可以对JSON做同样的事情.
Hi Patel. Some suggestions

1 - try to use a meaningful subject. You think anyone who posts here is NOT requesting help ?
2 - if you''re responding to an article, there''s a forum under the article
3 - if you''re responding to an earlier post, respond to that thread

In both cases, 2 and 3, doing that both keeps things orderly on this site, and sends an email to the person you''re trying to talk to.

The most probable answer is you need to concatenate your values and parse them on the other end. If you''re passing a URL, you can put as many query string parameters on there as you like. I believe you can do the same for JSON.


这篇关于请求有关同步JavaScript的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆