[英]Open a URL using window.open and passing data to it?
Honestly, I just want to know if something like this is even possible. 老实说,我只想知道这样的事情是否可能。
Let's say I used window.open("https://twitter.com/");
假设我使用
window.open("https://twitter.com/");
and I navigate to twitter. 然后导航到Twitter。 Is it possible to pass data to that page?
是否可以将数据传递到该页面?
For example, to put data into a text field on that page? 例如,要将数据放入该页面的文本字段中? Is it possible to get the elements of that page by their ID the same way would you by using
getElementById('')
? 是否可以通过使用
getElementById('')
方式按其ID获取该页面的元素?
Is doing something like this even allowed? 甚至允许这样做吗? I can't seem to find anything means of accomplishing something like this.
我似乎找不到任何能完成这样的事情的方法。
<script>
var t= 'sss';
window.open('http:www.twitter.com?id=78&otherdata='+t)
</script>
Like this way you can pass your data to url and then get it using GET request style URL. 这样,您可以将数据传递到url,然后使用GET请求样式URL进行获取。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.