运行服务器端代码而不提交当前页面? [英] Running server side code without submitting current page?

查看:76
本文介绍了运行服务器端代码而不提交当前页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要启动一些服务器端代码,但我不想提交

我正在访问的页面。我知道这在技术上是不可能的(没有

类似AJAX,也许?)。我认为可能工作的是弹出

另一个窗口(看不见?),让它运行代码,关闭自己和

返回结果。你怎么想,有可能吗?


如果你有任何想法,请告诉我。


Thx !!!

I need to fire off some server side code, but I don''t want to submit
the page I''m on. I know that''s not technically possible (without
something like AJAX, maybe?). What I thought might work is to pop-up
another window (invisibly?), have it run the code, close itself and
return the results. What do you think, is it possible???

Please let me know if you have any ideas.

Thx!!!

推荐答案



javelin写道:

javelin wrote:

我需要启动一些服务器端代码,但我不想提交

我正在访问的页面。我知道这在技术上是不可能的(没有

类似AJAX,也许?)。我认为可能工作的是弹出

另一个窗口(看不见?),让它运行代码,关闭自己和

返回结果。您怎么想,是否可能???


如果您有任何想法,请告诉我。


Thx !!!
I need to fire off some server side code, but I don''t want to submit
the page I''m on. I know that''s not technically possible (without
something like AJAX, maybe?). What I thought might work is to pop-up
another window (invisibly?), have it run the code, close itself and
return the results. What do you think, is it possible???

Please let me know if you have any ideas.

Thx!!!



如果您想要的是ping服务器而不对

结果做任何事情,请参阅此常见问题:

http://www.jibbering.com/faq/#FAQ4_34


否则,这就是Ajax的用途。顺便说一句,如果你认为你需要安装b / b
Ajax之类的东西,它不像Flash - 任何现代的

浏览器(IE5 +,Firefox,Safari等)支持Ajax的技术基于内置的
。学习它的工作原理并不会让你失望。

If all you want is to ping the server without doing anything with the
results, see this faq:

http://www.jibbering.com/faq/#FAQ4_34

Otherwise, that''s what Ajax is for. By the way, in case you think you
need to "install" Ajax or something, it''s not like Flash - any modern
browser (IE5+, Firefox, Safari etc.) supports the technology Ajax is
based on built-in. It won''t kill you to learn how it works.


标枪:écrit:
javelin a écrit :

我需要关闭一些服务器端代码,但我不想提交

我正在访问的页面。我知道这在技术上是不可能的(没有

类似AJAX,也许?)。我认为可能工作的是弹出

另一个窗口(看不见?),让它运行代码,关闭自己和

返回结果。您怎么想,是否可能???


如果您有任何想法,请告诉我。
I need to fire off some server side code, but I don''t want to submit
the page I''m on. I know that''s not technically possible (without
something like AJAX, maybe?). What I thought might work is to pop-up
another window (invisibly?), have it run the code, close itself and
return the results. What do you think, is it possible???

Please let me know if you have any ideas.



我有很多:-)


您可以使用向后弹出窗口(< body onload = " opener.focus()">)

你也可以玩一个看不见的iframe。


但更优雅的是使用XMLHttpRequest(部分阿贾克斯)


-

Stephane Moriaux et son(moins)vieuxMacdéjàdépassé

Stephane Moriaux和他的(少于)旧Mac已经过时

I''ve a lot :-)

You can play with a backward popup ( <body onload="opener.focus()">)
You can also play with an invisible iframe.

But more elegant is to use XMLHttpRequest (part of Ajax)

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date


ASM在2006年11月16日下午8:36说了以下内容:
ASM said the following on 11/16/2006 8:36 PM:

javelinaécrit:
javelin a écrit :

>我需要关闭一些服务器端代码,但我不想提交
页面我上线了。我知道'技术上不可能(没有像AJAX这样的东西,也许?)。我认为可能工作的是弹出另一个窗口(无形?),让它运行代码,关闭自己并返回结果。你怎么想,有可能吗?

如果你有任何想法,请告诉我。
>I need to fire off some server side code, but I don''t want to submit
the page I''m on. I know that''s not technically possible (without
something like AJAX, maybe?). What I thought might work is to pop-up
another window (invisibly?), have it run the code, close itself and
return the results. What do you think, is it possible???

Please let me know if you have any ideas.



我有很多:-)


您可以使用向后弹出窗口(< body onload = " opener.focus()">)

你也可以玩一个看不见的iframe。


但更优雅的是使用XMLHttpRequest(部分Ajax)


I''ve a lot :-)

You can play with a backward popup ( <body onload="opener.focus()">)
You can also play with an invisible iframe.

But more elegant is to use XMLHttpRequest (part of Ajax)



不,最优雅的是FAQ所指的那个,你可以通过
更改图像的.src服务器端脚本被触发。为什么

让它变得比以前更难?


-

兰迪

机会喜欢准备好的心灵

comp.lang.javascript常见问题 - http:// jibbering .com / faq

Javascript最佳实践 - http ://www.JavascriptToolbox.com/bestpractices/


这篇关于运行服务器端代码而不提交当前页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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