Fill an input-box by url without editing the receiver page

半世苍凉 提交于 2019-12-13 05:01:53

问题


I want to fill an input-box which I don't have any access on it ( so I can't add any javascripts ) with url. Something like :

http://google.com/#id_searchfield=text

I mentioned google so that you know that the receiver page is not under my control.

Is it possible or not ?

  • If it's impossible , Is there a way to do that with another page on a different domain instead of url ? ( some code or .. )

I have seen these but all of them needs access on the receiver page :

  • Pre-fill form field via URL in html

  • How can I pre-populate html form input fields from url parameters?

  • postMessage() Api

  • localstorage


回答1:


to send data via an URL you need to find the name of the object you want to fill, so in case of google, you need to go to
https://www.google.nl/?q=CongratzYouFoundIt
To add spaces replace them with %20, so
https://www.google.nl/?q=Congratz%20You%20Found%20It%20Again
Other special chars are aviable with HTML special Chars



来源:https://stackoverflow.com/questions/25719895/fill-an-input-box-by-url-without-editing-the-receiver-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!