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

Java onclick event opening two iframes

Hello Expert,

My problem:

I need multiple (12) web cam views (JPG refresh) on a page . The cams are Mobotoix web cams that can switch status by parsing parameters in their URL's. But to do what I want I need to send two commands and those can't be send in to one URL. So I came up with this sollution:

Make every table cell with a cam output in it clickable and use JavaScript to open up two 0% iframes with the two wanted url/paramater syntaxes.

But I have to parse the IP of every clicked cam to the javascript that opens the two iframes. Becouse the two URL's from the Iframes have to contain the right IPaddress.

Can you please profide me a code based on two cams?

Thanks,

Steynsk
0
Steynsk
Asked:
Steynsk
1 Solution
 
mltsyCommented:
Could you provide an example of how you would do one perhaps?  Or a link to a sample page?

If I understand you correctly, you just need to send an HTTP request to the camera to get it to perform some function.  But you want to perform 2 functions, so you need to send 2 HTTP requests with one click, without refreshing the page?

Sounds like a good application for an AJAX request to me.  I prefer to use Mootools for such things, so as to avoid all the cross-browser silliness.
Download here: http://mootools.net/download
Learn to use Request Object here: http://mootools.net/docs/Request/Request.HTML

Something like:
<input type="button" value="Change 2 settings" onclick="change2settings(IPAddress)" />
 
<script type="text/javascript">
  function change2settings(ip) {
    new Request({method: 'get', url: 'http://'+ip+'/requestHandler'}).send('function=func1');
    new Request({method: 'get', url: 'http://'+ip+'/requestHandler'}).send('function=func2');
  }
</script>

Open in new window

0
 
SteynskAuthor Commented:
Thanks
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

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