Jump to content


Photo

Call Php Function Using Jquery Ajax Inside A Custom Section ?


  • Please log in to reply
4 replies to this topic

#1 shannoga

shannoga

    Member

  • Members

  • 18 posts
  • Country: Country Flag

Posted 02 December 2012 - 08:33 AM

Hi 

 

I am calling a Facebook Graph API methods from a custom section I made.

It is very slow and I wish to call it with ajax only when the user asks for it.

 

I have tried -

 
jQuery('li').click(function(){
							
		jQuery.ajax({
			type :'GET',
			url  : 'get_album_images.php',
			success : function() {
                        }
              	});
});

What I can not figure is:

  1. Were should I put the php file and what id the correct url to it (I need it to be inside the section).
  2. Is that the right way to do it ?

How can I approach this from a section ?



#2 Danny

Danny

    Is Awesome!

  • Moderators
  • 15097 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 02 December 2012 - 10:36 AM

Hi,

 

I am not sure what you mean when you say "Were should I put the php file and what id the correct url to it (I need it to be inside the section)."

 

Can you go into more detail please.



#3 shannoga

shannoga

    Member

  • Members

  • 18 posts
  • Country: Country Flag

Posted 02 December 2012 - 01:01 PM

I can not figure out what should be the path to the php file that will hold the php functions for the ajax call?

assuming that the php file is in the section folder.



#4 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 02 December 2012 - 05:06 PM

It seems you're playing in the core files which is an unsupported activity that voids support.

 

There is a functions.php file found inside the PageLines Customize plugin (free in the Store > Plugins) or one inside the Base Theme (also free in the Store > Themes).  Use one of those or you will not only lose support, but likely crash your site.

 

Make absolutely sure you have the PageLines Sections plugin installed (found at Dashboard > PageLines > Store > (Sections which is the default)).

 

I should say that the majority of broken sites come from conflicts with jQuery.  Be prepared for anything. Since this is a customization, we'd not be able to provide technical help to resolve it except to say undo what was done.



#5 shannoga

shannoga

    Member

  • Members

  • 18 posts
  • Country: Country Flag

Posted 03 December 2012 - 08:16 AM

Hey

 

I don't understand your answer.

 

I am using a base theme and not the Customize plugin. I am using many jQuery plugins in my sections and the websites works great.

I am only trying to understand how to call jQuery ajax calls inside a section thats all.