SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 43 of 43

Thread: jQuery help!

  1. #26
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by emaarkhan View Post
    i use mainly all browsers. coz i have check for compatibility personal i like firebug. so whatever firebug comes in handy i use that
    In most browsers then (not IE) you can use ctrl+shift+j to bring up the javascript console, which reports on many types of errors.

    You can also find the javascript console (or error console) in the Tools menu.

    With IE8 you can use developer tools instead.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  2. #27
    SitePoint Wizard nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,766
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    well thats the problem. DW5 is not saying any syntax error.
    All those who wander aren't lost.

  3. #28
    SitePoint Wizard nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,766
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    if u can help me with that pls?
    All those who wander aren't lost.

  4. #29
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by emaarkhan View Post
    well thats the problem. DW5 is not saying any syntax error.
    No, it's won't, because DW5 is not a web browser.

    Try it out on Google Chrome, or Mozilla Firefox, or Safari or Opera. Since you test on mainly all browsers, you should have at least one of those available.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  5. #30
    SitePoint Wizard nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,766
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Uncaught SyntaxError: Unexpected token (
    but as i told i am new to JS, if u can point me my mistake, i can get along
    All those who wander aren't lost.

  6. #31
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by emaarkhan View Post
    Uncaught SyntaxError: Unexpected token (
    but as i told i am new to JS, if u can point me my mistake, i can get along
    The section that specifies the options for the dialog, finishes before the open option is specified. You need to close off the dialog options not before the open options, but after the open options instead.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  7. #32
    SitePoint Wizard nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,766
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Ah! ok, but one problem remains, the button isn't showing up, so i have to remove its autoOpen option, though that is what i need to be opened when clicked.
    Code JavaScript:
            <script type="text/javascript">
    		   $(function ()    {
    				$('#viewlog').dialog({
    					modal: true,
    					open: function ()
    					{
    						$(this).load('test.php');
    					},         
    					height: 529,
    					width: 1200,
    					title: 'Dynamically Loaded Page'
    				});
    			});
    		</script>
            <button id="viewlog">Click here</button>
    All those who wander aren't lost.

  8. #33
    SitePoint Enthusiast
    Join Date
    Aug 2010
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Firebug would be my choice...

    The first problem is the premature closing of the object before the open line. (as pmw57 has already noted).

    The second problem is that you are initializing dialog() on the button. When actually it should be initialized on a div and called from a click event of the button.

    Maybe the code below will make it more clear:

    Code:
    $(function(){
    	$("#dialog").dialog({
    		autoOpen:false,
    		modal:true,
    		height: 400,
    		width: 400,
    		title: 'Dynamically Loaded Page',
    		open: function ()
    		{$(this).load('log.php');}  
    	});
    	$("#viewlog").click(function()
    	{$("#dialog").dialog("open");});
    });
    HTML Code:
    <button id="viewlog">Click here</button>
    <div id="dialog"></div>

  9. #34
    SitePoint Wizard nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,766
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    well as i am new to JS, what does dialog("open") does? is it calling the open parameter in dialog
    All those who wander aren't lost.

  10. #35
    SitePoint Enthusiast
    Join Date
    Aug 2010
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code JavaScript:
    $("#dialog").dialog({
    		autoOpen:false,
    		modal:true,
    		height: 400,
    		width: 400,
    		title: 'Dynamically Loaded Page',
    		open: function ()
    		{$(this).load('log.php');}  
    	});

    The code above initializes the dialog (i.e. it assigns it to the div with id "dialog", and sets its properties and behavior).

    Whenever you want the dialog you described above to show and perform the described behavior, you call dialog("open").

  11. #36
    SitePoint Wizard nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,766
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    thanks wolken & pwn57. i spended the weekend studying about JS and i had many thing cleared. i do need something else. i have a Add button in my log.php page which open a new form, which it does now correctly. but what i want is to load log.php below the opened log.php, like slide from behind at the bottom. how can i do that? is it possible?
    All those who wander aren't lost.

  12. #37
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by emaarkhan View Post
    thanks wolken & pwn57. i spended the weekend studying about JS and i had many thing cleared. i do need something else. i have a Add button in my log.php page which open a new form, which it does now correctly. but what i want is to load log.php below the opened log.php, like slide from behind at the bottom. how can i do that? is it possible?
    The slideToggle method should be what you're after.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  13. #38
    SitePoint Wizard nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,766
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    so as log.php is opened. should i define another dialog functon in log.php, which will open the next dialog at bottom of log.php?
    Off Topic:

    ur answers are like riddles

    p.s i don't want my dialog to close when reloaded/refreshed. how can i do that?
    All those who wander aren't lost.

  14. #39
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by emaarkhan View Post
    so as log.php is opened. should i define another dialog functon in log.php, which will open the next dialog at bottom of log.php?
    You could create a separate update function where you pass it a reference to the last log entry on the page, and the new content for the log. The update could create a new (hidden) log below the current one, and then reveal it.[/quote]

    Off Topic:

    Quote Originally Posted by emaarkhan View Post
    ur answers are like riddles
    Give a man a fish and he eats for a day. Teach a man to fish he eats for the rest of his life.
    I'm not religious, but that's a part of the reason why I try to encourage you to do these these things for yourself.


    Quote Originally Posted by emaarkhan View Post
    p.s i don't want my dialog to close when reloaded/refreshed. how can i do that?
    So, your page needs to remember that for when someone returns. Cookies are commonly used for that. There is a good set of cookie-management functions at http://www.quirksmode.org/js/cookies.html
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  15. #40
    SitePoint Wizard nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,766
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    lol, nice example but when i have presure on my head i tend to forget thing, anyhow this is code i created in log.php which is opened in dialog box
    Code JavaScript:
    	$(function(){
    		$('#addpage').dialog({
    			autoOpen :false,
    			width: 1200,
    			height:100,
    			open : function(){
    				$(this).load('GenAddLog.php')
    			}
    		})//function dialog
    		$('#AddNew').click(function(){
    			$('#addpage').dialog("open")
    		});
    	});
    Code HTML4Strict:
    <button  type="button" class="buttons"  name="AddNew" id="AddNew">Add</button>
    but when i click button, nothing happens. does dialog box support opening of another dialog besides it? in my case i need it to slide down from bottom, am i missing something or what,
    Off Topic:

    i am learning fishing but i need help to catch some before i am on my own
    All those who wander aren't lost.

  16. #41
    SitePoint Enthusiast
    Join Date
    Aug 2010
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok, can you please show all the code you have until now ?

  17. #42
    SitePoint Wizard nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,766
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    basically, what i am doing is calling a dialog box inside from a dialog box.it work fine from the dummy page i created but here i m working on this page but its not working, nor i been prompted for any errors
    Code HTML4Strict:
    <link href="../stylesheets/jquery-ui-1.8.4.custom.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    .widthholder{width:300px; height:50px; overflow-x:auto;overflow-y:auto;}
    .left{width:500px; float:left; border-right:2px solid #C60;}
    </style>
     
    <script language="JavaScript" src="../scripts/calendar_us.js"></script>
    	<link rel="stylesheet" href="../scripts/calendar.css">
        <script language="text/javascript" src="../scripts/functions.js">
    </script>
    <script language="javascript" type="text/javascript">
    function checkDates()
    {
     
    }
    </script>
    <script type="text/javascript" src="../js/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="../js/jquery-ui-1.8.4.custom.min.js"></script>
    <script type="text/javascript">
    	$(function(){
    		$('#addpage').dialog({
    			autoOpen :false,
    			width: 1200,
    			height:100,
    			open : function(){
    				$(this).load('GenAddLog.php')
    			}
    		})//function dialog
    		$("#AddNew").click(function(){
    			$("#addpage").dialog("open")
    		});
    	});
    </script>
    </head>
     
    <!--<body onload="showHideDiv('1');">-->
    <body>
    <form name="ActionLog" method="post" >                                
    			<table width="1200" border="0" class="log">
                 <thead>
                    <tr>
                            <th width="50"><p>S.No.</p></th>
                            <th width="100"><p>Fault Date</p></th>
                            <th width="300"><p>Fault Description</p></th>
                            <th width="100"><p>Reported By</p></th>
     
                            <th width="200"><p>Resolution Date</p></th>
                            <th width="300"><p>Action Taken</p></th>
                            <th width="100"><p>Resolved By</p></th>
                            <th width="50"><p>Edit/Save</p></th>
                </tr>
                </thead>
                             	<?php
    					$count=0;
    					$query="select log_id,fault_date,fault_description,reported_by,resolution_date,action_taken,resolved_by,is_updated from genset_log where gensetid_fk='$GensetId' order by fault_date desc";
     
    					$cursor = OCIParse ( $connection, $query);
    					$result=ociexecute($cursor);
    					while(ocifetchinto($cursor,$values))
    					{
    						$count=$count+1;
    					?>
                       	<tbody> 
                         <tr>
     
                                <td  align="center" width="50px"><?php echo $count;?></td>
                                <td align="center"  width="100px"><?php if($edit == "1" && $lid==$values[0]){?><input type="text"  name="txtPass" id="txtPass" size="8" readonly="readonly" value="<?php echo convertTime($values[1]);?>" /><?php }else {echo $values[1];}?></td>
                                <td align="center"  width="300px"><div class="widthholder"><?php echo $values[2];?></div></td>
                                <td  align="center" width="100px"><?php echo $values[3];?></td>
                                <td  align="center" width="200px"><?php if($edit == "1" && $values[4] == "" && $lid==$values[0]){?><input type="text"  readonly="readonly" class="txtfield"  id="txtResolution" name="txtResolution"   />
                                <script language="JavaScript" type="text/javascript">
                                    new tcal ({
                                        // form name
                                        'formname': 'ActionLog',
                                        // input name
                                        'controlname': 'txtResolution'
                                    });
                                    </script>
     
                                <?php }else{echo $values[4];} ?></td>
                                <?php if($edit == "1" && $values[5] == "" && $lid==$values[0]){?><td  align="center" width="300px"><input type="text"  id="txtAction" class="txtfield" name="txtAction"  /></td><?php }else{?><td  align="center" width="300px"><div class="widthholder"><?php echo $values[5];} ?></div></td>
                                <td  align="center" width="100px"><?php if($edit == "1" && $values[6] == "" && $lid==$values[0]){?><input type="text"  id="txtResolvedBy" class="txtfield" name="txtResolvedBy"  /><?php }else{echo $values[6];} ?></td>
                                <td  align="center" width="50px"><?php if($edit == "1" && $lid==$values[0]){?><img onclick="return saveGenLog(<?php echo $GensetId;?>,<?php echo $values[0];?>,0)" src="../images/save.png"  alt="Save" border="0" /><?php }elseif($values[7] == "1"){}else{?><a href="javascript:saveGenLog(<?php echo $GensetId;?>,<?php echo $values[0];?>,1)" ><img src="../images/edit_16.png" alt="edit" border="0" /></a><?php }?></td>
     
                         </tr>
                         </tbody>
                         <?php
    					}
    					 ?>
                     </table>
    			<div class="mainButtonFlow">
                  <button  class="buttons"  name="AddNew" id="AddNew">Add</button>
    			<input type="submit" value="Close" class="buttons"  id="Close" name="Close"  onclick="javascript:window.close();"/>
                  <input type="hidden"  name="lid"  id="lid" >
                    <input type="hidden"  name="edit"  id="edit" >
                   <input type="hidden"  name="gid"  id="gid" >
                </div>
     
    </form>
    </body>
    </html>
    p.s i know the code is badly written but its not my code , the first dialog work fine. i think something is wrong here
    All those who wander aren't lost.

  18. #43
    SitePoint Wizard nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,766
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    i hope u bare with me the learning process. i know that option for dialog goes in {} but i am trying to achieve a slide/fade effect when second dialog box is called. i know its .fadeIn("slow") what i don't understand is where to put it, either in the {} or make a new function for dialog with same id and append it with .fadeIn ?
    All those who wander aren't lost.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •