jQuery Plugins » refresh https://jqueryplugins.info jQuery plugins, tutorials and resources Wed, 19 Oct 2011 11:13:08 +0000 en hourly 1 http://wordpress.org/?v=3.2.1 F5 (refresh) act as submit https://jqueryplugins.info/2011/10/f5-refresh-act-as-submit/ https://jqueryplugins.info/2011/10/f5-refresh-act-as-submit/#comments Sun, 09 Oct 2011 08:15:45 +0000 Admin https://jqueryplugins.info/2011/10/f5-refresh-act-as-submit/ Post link: F5 (refresh) act as submit

I have a hidden parameter called ‘act’ that should pass one of the values ‘load’, ‘save’ on pressing the submit button. The problem is when pressing on the F5 (refresh)...

]]>
Post link: F5 (refresh) act as submit

I have a hidden parameter called ‘act’ that should pass one of the values ‘load’, ‘save’ on pressing the submit button.

The problem is when pressing on the F5 (refresh) button after pressing the submit button because the url already contain ‘&act=save’ so prssing on F5 actually pass (to cgi) the ‘save’ value again (and it perform the save action again even I didn’t press on the submit button.

The queston is how can I prevent sending the ‘&act=save’ on pressing the reffresh button?

Thanks

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/10/f5-refresh-act-as-submit/feed/ 0
Getting a nice transition effect with jquery, php sessions and a page refresh? https://jqueryplugins.info/2011/10/getting-a-nice-transition-effect-with-jquery-php-sessions-and-a-page-refresh/ https://jqueryplugins.info/2011/10/getting-a-nice-transition-effect-with-jquery-php-sessions-and-a-page-refresh/#comments Fri, 07 Oct 2011 01:13:59 +0000 Admin https://jqueryplugins.info/2011/10/getting-a-nice-transition-effect-with-jquery-php-sessions-and-a-page-refresh/ Post link: Getting a nice transition effect with jquery, php sessions and a page refresh?

I am looking to make a nice transition effect for a dynamic user layout system I have created. My layout relies on a session being either the value of 1...

]]>
Post link: Getting a nice transition effect with jquery, php sessions and a page refresh?

I am looking to make a nice transition effect for a dynamic user layout system I have created.

My layout relies on a session being either the value of 1 or 2, I then call the layout using a switch statement.

switch ($  _SESSION['layout']) {

    case 1: break;
    case 2: break;
}

I have also created a button that they can click to change the layout using ajax. The jquery for this is like so:

$  ('#changeLayout').click(function() {

    $  .ajax({data: {changeLayout: 'mainLayout'}});
    $  ('#fluidWrap').fadeOut();
    setTimeout(function() {
        window.location = 'http://www.example.com/preferences';
    }, 1000);
return false;
});

The ajax is as follows:

if ($  _SESSION['layout'] == 1) {

    $  q = $  dbc -> prepare("UPDATE layout SET layout = 2 WHERE id = ?");
    $  q -> execute(array($  _SESSION['id']));
    $  _SESSION['layout'] = '2';
}
else {
    $  q = $  dbc -> prepare("UPDATE layout SET layout = 1 WHERE id = ?");
    $  q -> execute(array($  _SESSION['id']));
    $  _SESSION['layout'] = '1';
}

Now at the minute when the user clicks the button to change the layout the div #fluidWrap fades out, the ajax request has 1 second to change the session data and add it to the database, and the page reloads. All works well.

I was wondering how I can improve on this to maybe make a transition effect where the page slides out and slides back in again, how would I go about doing this?

I can’t add an effect with jquery for the div #fluidWrap to fade in, as on every load of the page it will of course fade in. How can I tell jquery to only fade in the body if the button was clicked after a page load?

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/10/getting-a-nice-transition-effect-with-jquery-php-sessions-and-a-page-refresh/feed/ 0
how to refresh only a part of the page when F5 or refresh button is pressed https://jqueryplugins.info/2011/09/how-to-refresh-only-a-part-of-the-page-when-f5-or-refresh-button-is-pressed/ https://jqueryplugins.info/2011/09/how-to-refresh-only-a-part-of-the-page-when-f5-or-refresh-button-is-pressed/#comments Sat, 24 Sep 2011 15:14:10 +0000 Admin https://jqueryplugins.info/2011/09/how-to-refresh-only-a-part-of-the-page-when-f5-or-refresh-button-is-pressed/ Post link: how to refresh only a part of the page when F5 or refresh button is pressed

I’m designing a web application that has a shared menu for all pages. Due to this i decided to load the contents linked by the menu buttons inside a div,...

]]>
Post link: how to refresh only a part of the page when F5 or refresh button is pressed

I’m designing a web application that has a shared menu for all pages. Due to this i decided to load the contents linked by the menu buttons inside a div, using jquery.

So, i have this:

     $  ("#AddNewProductBtn").click(function() {
       $  ("#content").load("addproduct.html");
   });

I want to keep track of the page displayed inside the “#content” div. If the users refreshes the page i want to load the same page in “#content”. Is there any way to do this, or is there any workaround?

I saw some websites that use an iframe to load the pages, but when a user clicks a button in the menu the url is also changed. I didn’t find any info on how to do that.

Thanks

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/09/how-to-refresh-only-a-part-of-the-page-when-f5-or-refresh-button-is-pressed/feed/ 0
JQuery Sortable – Serialize Includes Removed Element Despite ‘Refresh’ https://jqueryplugins.info/2011/09/jquery-sortable-serialize-includes-removed-element-despite-refresh/ https://jqueryplugins.info/2011/09/jquery-sortable-serialize-includes-removed-element-despite-refresh/#comments Mon, 19 Sep 2011 05:20:38 +0000 Admin https://jqueryplugins.info/2011/09/jquery-sortable-serialize-includes-removed-element-despite-refresh/ Post link: JQuery Sortable – Serialize Includes Removed Element Despite ‘Refresh’

I have a pretty standard implementation of a UL with LI items that are sortable. When I change the sort order, it works fine and sends the array without issue....

]]>
Post link: JQuery Sortable – Serialize Includes Removed Element Despite ‘Refresh’

I have a pretty standard implementation of a UL with LI items that are sortable. When I change the sort order, it works fine and sends the array without issue. However, if I remove one of the sortable elements and then call a refresh, and then serialize again to send the updated elements, the element that I removed is still included in the new serialized array I create.

This is driving me nutty… I cannot figure this one out.

$  ('.removeItem').click(function() {

var id = $  (this).attr('id');
var recordid = $  ('.indent ul').attr('data-id');
var item = $  (this).parent();

$  .ajax({
    type: 'POST',
    url: 'tasks.php',
    data: 'action=delphoto&id='+id,
    success: function(data) {

    item.remove(); /*the thumbnail and its container are removed*/
    $  ('.sortable ul').sortable('refresh'); /* supposed to now notice one less element?*/

    /* Now I send off the serialized array of remaining elements after the remove and refresh*/
    var reorder = $  ('.sortable ul').sortable("serialize") + '&action=sort&id='+recordid;

        $  .post("tasks.php", reorder, function(result){
        var output = data + result;
        alert(output,type);

        })

    }
})
return false;
});

When I examine the posted array, I see the elements currently visible AND the one that I deleted prior to the refresh and serialize. So if I had 10 thumbnails and dragged them around, the serialized array is perfect. If I choose to delete one and use the the JQUERY .remove() method, the element disappears but it still included in the serialization. I have tried this in the .live(‘click’,function(){} and still get the extra element.

Any ideas?

Thanks!

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/09/jquery-sortable-serialize-includes-removed-element-despite-refresh/feed/ 0
jQuery .ajax not working, form posts with page refresh https://jqueryplugins.info/2011/09/jquery-ajax-not-working-form-posts-with-page-refresh/ https://jqueryplugins.info/2011/09/jquery-ajax-not-working-form-posts-with-page-refresh/#comments Sun, 18 Sep 2011 05:13:11 +0000 Admin https://jqueryplugins.info/2011/09/jquery-ajax-not-working-form-posts-with-page-refresh/ Post link: jQuery .ajax not working, form posts with page refresh

I have the following html code: (that gets loaded via ajax into a div) (Cut out the irrelevant parts) <form id='addContactForm' method='post' action='/contact/create/'> <div> <input type="image" name="submit" id="addContactSubmit" src="/images/add-small.png" style="width:...

]]>
Post link: jQuery .ajax not working, form posts with page refresh

I have the following html code: (that gets loaded via ajax into a div)

(Cut out the irrelevant parts)

<form id='addContactForm' method='post' action='/contact/create/'>
    <div>
        <input type="image" name="submit" id="addContactSubmit" src="/images/add-small.png" style="width: auto; vertical-align: bottom;">
    </div>
</form>
<script>
$  ('#addContactSubmit').click(function(){
  alert('got here');
  $  .ajax({
    type: 'POST',
    url: '/contact/create/',
    data: $  ("#addContactForm").serialize(),
    success: function(data, status, xhttp) {
      if ( data ) { alert ('Got Data'); } else { alert('No Data'); }
    },
    dataType: html
  });
  return false;
});
</script>

So now when I click on the <image>, it actually posts the form and refreshes the page. I read another post that stated that the problem was that jquery wasn’t loaded, and once loaded that fixed the problem. However, in this case, I am getting the alert, which tells me that jquery is loading (as the click event is triggering fine), however it seems the $ .ajax portion is not being executed (or there is a problem with it). If I remove the $ .ajax portion, I get the alert, and the page does not submit and reload.

Originally I stated that this form html gets loaded via an ajax call on the main page, and I am wondering if that has something to do with the failing ajax post. Note I also never get the alert (‘Got Data’) or (‘No Data’), only the alert ‘got here’

any insite would be great. Thanks

Another note, I am getting no errors in firebug.

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/09/jquery-ajax-not-working-form-posts-with-page-refresh/feed/ 0
Refresh dynamicaly created page in jquery mobile https://jqueryplugins.info/2011/09/refresh-dynamicaly-created-page-in-jquery-mobile/ https://jqueryplugins.info/2011/09/refresh-dynamicaly-created-page-in-jquery-mobile/#comments Fri, 16 Sep 2011 15:19:38 +0000 Admin https://jqueryplugins.info/2011/09/refresh-dynamicaly-created-page-in-jquery-mobile/ Post link: Refresh dynamicaly created page in jquery mobile

i have the following problem : I’m using Jquery mobile , user can search for products and the details of those page are created dynamically : something like : $...

]]>
Post link: Refresh dynamicaly created page in jquery mobile

i have the following problem :

I’m using Jquery mobile , user can search for products and the details of those page are created dynamically :

something like :

 $  ("body").append('<div class="products" data-role="page" id="'+pageId+'"><div data-role="header"><p class="backSearch"><a href="#base" data-rel="back" data-role="button" data-inline="true" data-icon="back">back</a></p><h1>' +data.title+ '</h1></div></div>');

 // create the content DIV
 $  ('#'+pageId).append('<div data-role="content" id="content_'+pageId+'">...</div>');

It’s working fine , but the problem is that when you go to the product details and you click on the refresh the form appears again and since the Dom is refreshed i don’t have access to the product details anymore (need to do another search etc..)

Any solution in mind to resolve this issue ?

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/09/refresh-dynamicaly-created-page-in-jquery-mobile/feed/ 0
Refresh text input on jQuery Mobile https://jqueryplugins.info/2011/09/refresh-text-input-on-jquery-mobile/ https://jqueryplugins.info/2011/09/refresh-text-input-on-jquery-mobile/#comments Wed, 07 Sep 2011 16:23:14 +0000 Admin https://jqueryplugins.info/2011/09/refresh-text-input-on-jquery-mobile/ Post link: Refresh text input on jQuery Mobile

I’d like to refresh in an input text after dynamically add the attribute “date-theme”. How can I do this? newest questions tagged jquery – Stack Overflow

]]>
Post link: Refresh text input on jQuery Mobile

I’d like to refresh in an input text after dynamically add the attribute “date-theme”.

How can I do this?

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/09/refresh-text-input-on-jquery-mobile/feed/ 0
How automatically refresh a div upon a successful ajax execution https://jqueryplugins.info/2011/09/how-automatically-refresh-a-div-upon-a-successful-ajax-execution/ https://jqueryplugins.info/2011/09/how-automatically-refresh-a-div-upon-a-successful-ajax-execution/#comments Tue, 06 Sep 2011 02:55:57 +0000 Admin https://jqueryplugins.info/2011/09/how-automatically-refresh-a-div-upon-a-successful-ajax-execution/ Post link: How automatically refresh a div upon a successful ajax execution

I am trying to refresh the div that contains a table that show the data after a successful insertion of new data using ajax. Here’s my code: $ ("span.save").live('click', function()...

]]>
Post link: How automatically refresh a div upon a successful ajax execution

I am trying to refresh the div that contains a table that show the data after a successful insertion of new data using ajax.

Here’s my code:

            $  ("span.save").live('click', function() { 

                var id = $  (this).attr('id');
                var name = $  ('.ingr_name_' +id).val();
                var amount = $  ('.amt_' +id).val();
                var unit = $  ('.unit_' +id).val();

                if(name.length > 0 && amount.length > 0 && unit.length > 0)
                {
                    var dataString = "id=<?php echo $  this->uri->segment(3); ?>&name=" +name +"&amount=" +amount +"&unit=" +unit;

                    //alert(dataString);

                    $  .ajax({
                       type: "POST",
                       url: "<?php echo base_url(); ?>recipe/add_ingr",
                       data: dataString,
                       success: function(){
                           //I wanted to refresh the div here. Where the div's id="ingredients_list"

                           alert('Recipe ingredient added.')
                       },
                       error: function(xhr, status, error) {
                            alert(error)
                       }
                    });

                    return false;
                }
                else
                {
                    alert("Please fill out all fields.");
                }

            });

I’ve been searching how to do the div refresh but they don’t fit my needs for this problem. Can anyone help me with this? Thank you for your help.

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/09/how-automatically-refresh-a-div-upon-a-successful-ajax-execution/feed/ 0
Switching Quicktime video without page refresh https://jqueryplugins.info/2011/08/switching-quicktime-video-without-page-refresh/ https://jqueryplugins.info/2011/08/switching-quicktime-video-without-page-refresh/#comments Tue, 30 Aug 2011 21:16:52 +0000 Admin https://jqueryplugins.info/2011/08/switching-quicktime-video-without-page-refresh/ Post link: Switching Quicktime video without page refresh

I’m trying to switch a quicktime video without having to refresh the page. This is my standard Embed code: <OBJECT classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' width="402" height="327" codebase='http://www.apple.com/qtactivex/qtplugin.cab'> <param name='src' value="movie_previews/dinner_conversation_prt2.mov"> <param name='autoplay' value="true">...

]]>
Post link: Switching Quicktime video without page refresh

I’m trying to switch a quicktime video without having to refresh the page. This is my standard Embed code:

            <OBJECT classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' width="402" height="327" codebase='http://www.apple.com/qtactivex/qtplugin.cab'>
        <param name='src' value="movie_previews/dinner_conversation_prt2.mov">
        <param name='autoplay' value="true">
        <param name='controller' value="true">
        <param name='loop' value="false">
        <EMBED src="movie_previews/dinner_conversation_prt2.mov" width="402" height="327" autoplay="true" controller="true" loop="false" bgcolor="#000000" pluginspage='http://www.apple.com/quicktime/download/'> </EMBED>
        </OBJECT>

And this is how I have my links setup:

<p><a href="movie_previews/revolving_door_prt2.mov">Preview Video 1</a></p>
<p><a href="movie_previews/breakfast_in_bed_prt2.mov">Preview Video 2</a></p>
<p><a href="movie_previews/bathtub _prt2.mov">Preview Video 3</a></p>

How do I go switch the code on my embed above without reloading the whole thing? I am guessing AJAX/jQuery but this i snot my strength.
Thanks a lot it advance for any pointers.

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/08/switching-quicktime-video-without-page-refresh/feed/ 0
Q&A: Refresh PHP codes with new data from database without refreshing page.? https://jqueryplugins.info/2011/08/qa-refresh-php-codes-with-new-data-from-database-without-refreshing-page/ https://jqueryplugins.info/2011/08/qa-refresh-php-codes-with-new-data-from-database-without-refreshing-page/#comments Sun, 28 Aug 2011 02:08:42 +0000 Admin https://jqueryplugins.info/2011/08/qa-refresh-php-codes-with-new-data-from-database-without-refreshing-page/ Post link: Q&A: Refresh PHP codes with new data from database without refreshing page.?

Question by Mythia: Refresh PHP codes with new data from database without refreshing page.? How do I get the most updated information that has been entered in the database without...

]]>
Post link: Q&A: Refresh PHP codes with new data from database without refreshing page.?

Question by Mythia: Refresh PHP codes with new data from database without refreshing page.?
How do I get the most updated information that has been entered in the database without waiting for someone to refreshing the web page that they are on?

Please send me some website links or type up some example scripts for me plz… Thanks soooo much!

At the moment i have on my home page All the recent post from people but in order to see the latest you have to refresh page… I really dont want to do that.. I want it to automatic show me the newest one with me just looking at it… So i think i need AJAX and JQUERY??? Please Advise!

Best answer:

Answer by David
Your question basically describes AJAX.

Download an AJAX ebook for free online and dive in.

What do you think? Answer below!

]]>
https://jqueryplugins.info/2011/08/qa-refresh-php-codes-with-new-data-from-database-without-refreshing-page/feed/ 1