Solved

Java onclick event opening two iframes

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

747 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

11 Experts available now in Live!

Get 1:1 Help Now