• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 270
  • Last Modified:

Javascript - intracting with another page.

Hi,

Can I lanch a page (window.open) that is not mine (I cannot change it) and then
interact (get data or write to <input>) with controls in it?
0
VapiSoft
Asked:
VapiSoft
  • 3
  • 2
3 Solutions
 
Jini JoseSenior .Net DeveloperCommented:
i think it is not possible. because you cannot change the opened page. if you can change the opened page, then you can get the return values from it.
0
 
stergiumCommented:
you could insert a page inside a <div> and then change whatever you want .
i'd use jquery (ajax) for that but a new page that cannot be change i dont see a way around it.
0
 
VapiSoftAuthor Commented:
To stergium,

How do I do that?
This is good enouh for me if I can do it bacsuse What I need is to automate a test their.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
stergiumCommented:
i was thinking something like this
 <script type="text/javascript" src="jquery.js"></script>  
<script type="text/javascript">
$(document).ready(function() {
$.ajax({
  url: "test.html",
  context: document.body,
  success: function(){
$('#input1').val('values'); // input1 that gets the value 'values'
  }
});
 });
</script>


0
 
VapiSoftAuthor Commented:
Hi,
I tried to run it and I receive an error - Object expected. The error
0
 
VapiSoftAuthor Commented:
I forgot to add the code.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<title>JS Bar Graph</title>
<script type="text/javascript" src="jquery.js"></script> 
<script type="text/javascript">
$(document).ready(function() {
$.ajax({
  url: "https://www.misim.gov.il/svInfoNadlan/index.html",
  context: document.body,
  success: function(){
$('#input1').val('values'); // input1 that gets the value 'values'
  }
});
 });
</script>
 
</head>
<body>
<div id="input1"></div>
</body>
</html>

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now