Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7068011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:16:18+00:00 2026-05-28T05:16:18+00:00

I have an html button: <button id=monitor onclick=startMonitor(‘<?php echo $result_cameras[$i][camera_hash]; ?>’, ‘<?php echo $result_cameras[$i][camera_name];

  • 0

I have an html button:

<button id="monitor" onclick="startMonitor('<?php echo $result_cameras[$i]["camera_hash"]; ?>', '<?php echo $result_cameras[$i]["camera_name"]; ?>', '<?php echo $camera_quality_flash; ?>');">Monitor</button>

This would load flash content:

<script language="javascript" type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js"></script>
<script language="javascript" type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.js"></script>
<script type="text/javascript">
var js = jQuery.noConflict();

var startMonitor = function(cameraHash, cameraName, cameraFlashQuality) {
var url = ['flash/app.php?user=<?php echo $id_hash; ?>', 'camera=' + cameraHash, 'name=' + encodeURIComponent(cameraName), 'quality=' + cameraFlashQuality].join('&');
js('<div></div>').load(url, function() {
    js(this).dialog();
});
};

I want to use the jquery dialog to open this content. Everything passed in seems to be perfect (according to the GET response from firebug) but I still get a jquery error.

missing ; before statement jquery.js line 612

What am I doing wrong? I’m not even sure how to debug this. Thanks in advance.

EDIT:
Firebug reports the GET as: http://myurl.com/flash/app.php?user=dee8c751cfdd2b5fb8194a3a9bac12044621df3d&camera=8f753c6bb3a8d9852a220abff0ed0d7686563007&name=test22&quality=0. I expect these values.

If I paste this url into my browser the flash app starts in the browser as expected but not with the jquery dialog obviously. Must be something wrong with my jquery code?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:16:19+00:00Added an answer on May 28, 2026 at 5:16 am

    (Incorrect answer removed.)


    Edit:

    Initially, I misinterpreted the jquery.js as a file you created, rather than the real jquery. After testing out the code, I can see that the data that you are sending may be the problem. Can you post a sample with the data for $result_cameras[$i]["camera_hash"], $result_cameras[$i]["camera_name"],$camera_quality_flash, and $id_hash? Also, what is the value for url that results?


    Solution:

    The button submits the form, and the page is reloading. The dialog shows, but then the page is immediately reloaded, so it seems like there never was a dialog. In order to prevent this behavior, the button’s click() function has to return false (if no value is return, it is treated as a true result).

    Notes on this solution:

    1. Relies on the objects being in existence, so I moved everything inside a ready() event.
    2. Assumes this one of many buttons inside a loop (because of the $i variable in the PHP code), so the data is in the attributes of the button.
    3. Since there may be several buttons with the same functionality, it is generalized for multiples.
    4. The jQuery load command (cf., http://api.jquery.com/load/ ) takes 3 paramenters:
      • the url
      • some data
      • a callback function for when the load returns (if you only provide 2 parameters, the second one is assumed to be the callback function). The callback parameters are:
        • responseText, the HTML returned from the server
        • textStatus, a status message
        • XMLHttpRequest, the request interface, which can be used to see various info about the request (cf., http://www.w3.org/TR/XMLHttpRequest/)

    The HTML test file:

    <html>
    <head>
    <script language="javascript" type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js"></script>
    <script language="javascript" type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.js"></script>
    </head>
    <body>
    <form>
        <?php 
            $i = 0;
            $result_cameras = array(array("camera_hash" => "test1", "camera_name" => "test2"));
            $camera_quality_flash = 1;
            $id_hash = "hashish";
    
            echo '<button id="monitor1" class="monitor" camHash="' . $result_cameras[$i]["camera_hash"] . '" camName="' . $result_cameras[$i]["camera_name"] . '" camQual="' . $camera_quality_flash . '" >Monitor 1</button>';
            echo '<button id="monitor2" class="monitor" camHash="' . $result_cameras[$i]["camera_hash"] . '-2" camName="' . $result_cameras[$i]["camera_name"] . '-2" camQual="' . $camera_quality_flash . '-2" >Monitor 2</button>';
        ?>
        <div class="tester">TEST DIV</div>
    </form>
    </body>
    
    <script type="text/javascript">
        var js = jQuery.noConflict();
        js(document).ready(function(){
    
            var monitor = js(".monitor");
            //alert(monitor[1]);
    
            monitor.each(
                function(i){ 
                    js(this).click(
                        function(){
                            //alert(js(this).attr('camHash'));
                            startMonitor( 
                                js(this).attr('camHash'),
                                js(this).attr('camName'),
                                js(this).attr('camQual')
                            ); 
                            return false;
                        }
                    );
                }
            );
    
            var startMonitor = function(cameraHash, cameraName, cameraFlashQuality) {
    
                var url = [
                        'flash/app.php?user=<?php echo $id_hash; ?>', 
                        'camera=' + cameraHash, 
                        'name=' + encodeURIComponent(cameraName), 
                        'quality=' + cameraFlashQuality
                    ].join('&');
    
                js('<div>TEST DIV 2</div>').load(url
                    , function(response, status, xhr) {
                        js('.tester').text( "<div>xhr: <br />"
                            + xhr.status + "<br />"
                            + xhr.statusText + "<br />"
                            + xhr.getAllResponseHeaders() + "<br />"
                            + xhr.responseText + "<br />"
                            + xhr.responseXML + "<br />"
                            + "</div>"
                        );
    //                  js(this).dialog();
                    }
                );
            };
        });
    </script>
    
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an html button which is really just this: <div onClick=window.location.href=somePage.htm> <img src=img.png/>
This is probably a basic html/css question... I have a simple one-button form that
I have following code: $boxId = 1; $explainationBox='<input type=button id=<?php echo $boxId; ?> value=send
This is pretty noob question, if I have an html button: and when the
I have the following html button <td><form id=form2 name=form2 method=post onclick=../cgi-bin/py/GuestBookEntry.py> <input type=submit name=gBookSrib
I have a HTML button like <input type=button id=button onclick=showSuper() value=Click Me! /> Inside
I have html like this: <html> <input type='button' name='button1' id='button1'> <input type='button' name='button2' id='button2'>
How do I insert PHP code into a HTML Button? Here's what I have:
I have a site that has a simple HTML button in a form. All
I have ASP.Net code generating my button's HTML for me using divs to get

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.