?
Solved

Java onclick event opening two iframes

Posted on 2008-10-29
2
Medium Priority
?
488 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 2000 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…
Suggested Courses

801 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