Solved

Java onclick event opening two iframes

Posted on 2008-10-29
2
484 Views
Last Modified: 2010-04-21
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
Comment
Question by:Steynsk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Accepted Solution

by:
mltsy earned 500 total points
ID: 22831962
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
 
LVL 1

Author Closing Comment

by:Steynsk
ID: 31511133
Thanks
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question