jQuery get variable value from another html page
问题 I have got an html page with this content, called "page1.html": <div> <div id="content"> content </div> <script type="text/javascript"> var x=5; var y=2; </script> <div id="other">Some other content</div> </div> In another html page, I'd like to get the value of the variable "x" (5). This is the main page: <!DOCTYPE html> <html> <head lang="en"> <script type="text/javascript" src="app.js"></script> </head> <body> <div id="new_content"></div> </body> </html> And this is the app.js script: $