Javascript提示显示执行值 [英] Javascript Prompt displaying executed value

查看:39
本文介绍了Javascript提示显示执行值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有此代码:

<input type="button" value="Test Short URL" onClick="javascript:void(location.href='http://taimoorsultan.com/y/yourls-api.php?signature=05e2685fc7&format=simple&action=shorturl&url='+escape(location.href))&prompt('Shorten URL', 'shorturl');">

实际上,此代码获取url并对其进行处理,并在下一个空白页上显示一个简短的url.我正在尝试通过hint()在同一页面上显示该缩短的url.使用上面的代码对我来说有点混乱.如何处理短网址,而又不允许其在下一页上显示结果?

Actually this code takes url and process it and show a shorten url on next blank page. I was trying to display that shorten url on the same page through prompt(). Using the above code is bit confusing for me. How I can process the short url without allowing it to display the result on next page?

我认为我应该先处理action =",然后在提示框中做一些显示结果的操作.但是不知道该怎么做.请帮忙!

I think I should first process the action="" and then do something to show results within a prompt box. But don't know how to do this. Help please!

推荐答案

我认为我应该先处理action =",然后在提示框中执行一些操作以显示结果.

I think I should first process the action="" and then do something to show results within a prompt box.

使用以下过程:

  • 具有 action 作为上述.php URL
  • 具有 button submit
  • 删除 onclick
  • 添加ID为 foo
  • 的iframe
  • 具有 target #foo"
  • Have action be the aforementioned .php URL
  • Have button be submit
  • Remove onclick
  • Add an iframe with an ID of foo
  • Have target be "#foo"

这篇关于Javascript提示显示执行值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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