We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Help calling an add-on method via AJAX

Development and Programming

jwrudzin's avatar
jwrudzin
1 posts
8 years ago
jwrudzin's avatar jwrudzin

I’m working on updating a fieldtype add-on to work with EE3. This add-on calls one of its own php functions from a javascript file to make some DB updates without reloading the page.

In EE2, the javascript called the function using $.get and a URL formatted like this:

http://www.mysite.com/admin.php?S=0&D=cp&S=0&C=addons_modules&M=show_module_cp&module=module_name&method=method_name&param1=param1value&param2=param2value

This style of URL is not working for me in EE3 - I am getting a 404 not found error in the console when the $.get runs.

What format do I need to use for the URL in EE3 to access a function of my module (and pass in parameters)?

I thought I might be able to use an ACT to accomplish this, but I need the module to work on multiple installations so I can’t hardcode the ACT id into my javascript file (and I’m not aware of any way to pull the ACT id from the database in a javascript file).

I really appreciate your help!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.