[SOLVED] jQuery toggle not working for ajax loaded content

Some days ago while doing code for my client, I faced an issue with toggle function of jquery, and realized a fact about this function which I never knew earlier that jquery toggle function does not work for ajax loaded content.

I tried to make it work by using it in different ways but it did not work then after researching on google I came to know that toggle function will not work for content who is added dynamically in body tag. So, I had to find out the alternate of toggle function to get my work done. My code using toggle function was as which was working for content which was not shown through ajax : Keep on reading

[Solved] How to set dynamic confirmation url in ajax enabled gravity form OR Redirect user to the newly created post by gravity form

In gravity form settings, there are two kind of confirmations, first is redirect url and second is text. You can either redirect user to another page like thank you page after form submission or you can show the confirmation text like thank you, your form is submitted successfully.

For the redirect setting, we can use there form field values also, to set string etc, but we can’t set there completely dynamic url on based of conditions. For example, I have used Post fields in my gravity form, from which post creates automatically after submitting the form. Now, if I want ti redirect my user to the newly created post which is just created by him by submitting the form, then I cannot do it via Form settings. Keep on reading

wp nonce in ajax calls to secure ajax call request

We all know that it is a best protocol to use wp nonce methods in wordpress to secure the POST or GET requests. WordPress nonce method creates a string that can be used once and have a limited lifetime after they expire. Thus by verifying the created nonce we can authenticate the incoming request. To use wp-nonce in ajax calls, first we will have to pass the nonce to our jquery file, in which we are having code of ajax request.

To pass the nonce value in jquery file, we will have to localize the jquery script as : Keep on reading

Javascript Google Map API : Change the content of infowindow using AJAX

Its an interesting subject that how one can change the content of google map’s infowindow dynamically. Many times we need to perform an action which results in change of content of infowindow also.

For example, if we have displayed a like button for a particular place which is showing in the content, and its marker is also showing in map. On clicking on that marker, infowindow will launch. Infowindow will also have the same like button. If user clicks on like button of place which is showing in content then we may need to change the style or text of infowindow’s like button also, whenever infowindow will be launched, to show that it is liked now. Keep on reading

[SOLVED] jQuery.text() method returning repeated text

jQuery has a method .text() which is used to get text of any html element. I have used it many times but one day it consumed my so much time because it was returning the text twice. I spent so much time but I didn’t get the issue. Then I read its details and I came to know if the selector which you are selecting to get text is present more than one time on your page then it gives the concatenated text.

For example, I was selecting an anchor tag under div having class filters, so my code was : Keep on reading