Javascript: Get Value From Popup (external Website) February 03, 2024 Post a Comment I'm using this code to get a value from a field in popup. http://myotherwebsitename.com/parent.html OpenSolution 1: Due to same origin policy you can't get info from another website. here is a better definition of why...In computing, the same-origin policy is an important security concept for a number of browser-side programming languages, such as JavaScript. The policy permits scripts running on pages originating from the same site – a combination of scheme, hostname, and port number[1] – to access each other's DOM with no specific restrictions, but prevents access to DOM on different sites.[1] Same-origin policy also applies to XMLHttpRequest and to robots.txt.http://en.wikipedia.org/wiki/Same-origin_policy. hope this helps. I'll see if I can find a workaround and let you know though.Solution 2: Yep, same origin policy...Baca JugaHow To Convert An Html String To A Pdf Inputstream?Safari 6 (ios 6) Flex Layout Doesn't Wrap ElementsChecking Image Size Using Jquery Validation Not WorkingIf you have access to external site, you can grant access to your first domain by setting Access-Control-Allow-Origin header on request OPTIONS. Here PHP example: if (isset($_SERVER['HTTP_ORIGIN']) && in_array($_SERVER['HTTP_ORIGIN'], $allowedList)) { header('Access-Control-Allow-Origin: ' . $_SERVER['HTTP_ORIGIN']); header('Access-Control-Allow-Methods: POST, GET, OPTIONS'); header('Access-Control-Allow-Credentials: true'); header('Access-Control-Max-Age: 1000'); header('Access-Control-Allow-Headers: X-Requested-With, Content-Type'); exit; } CopyBut you should known, that HTTP_ORIGIN contains schema, and you should specify both http and https domains in $allowedList. Share You may like these postsColums Resize When Using Jquery Ui's Toggle In IeJquery Ui Flipping Text Like In Gumroad.comHow Do I Create A Title Bar With Some Text To The Left And Some To The Right?Css Issue With Jquery Ui Tabs Post a Comment for "Javascript: Get Value From Popup (external Website)"
Post a Comment for "Javascript: Get Value From Popup (external Website)"