Solved

Java onclick event opening two iframes

Posted on 2008-10-29
2
481 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
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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…

815 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now