TOPIC:

SOLVED Load PHP inside init script (php inside javascript) 1 week 1 day ago #260307

  • Topic Author
  • shinzan
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 68
  • Thanks: 0
I'm trying something more complex than this but this is so basic and it would work in standard javascript.

whats am I missing?
function ff_Expenses_Station_init()
{

	 alert('<?php echo date("Y/m/d"); ?>');

} // ff_Expenses_Station_init

this throws an error on the console of:

Uncaught SyntaxError: identifier starts immediately after numeric literal

what I'm actually trying to do is load a php query then echo out an array into a javascript to power a google chart but if I can't even do this the rest is out of the question because something is wrong on a basic level:

Something like this:


Please Log in or Create an account to join the conversation.

Last edit: Post by shinzan.

Load PHP inside init script (php inside javascript) 1 week 18 hours ago #260313

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 6086
  • Karma: 3
  • Thanks: 429
Hi,

please try this:
function ff_Expenses_Station_init()
{
var date = "<?php echo date("Y/m/d");?>";
    alert(date);
}

Regards,
Tihana

Please Log in or Create an account to join the conversation.

Load PHP inside init script (php inside javascript) 1 week 7 hours ago #260337

  • Topic Author
  • shinzan
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 68
  • Thanks: 0
Thank you very much, but that didnt work either gave:

Uncaught SyntaxError: identifier starts immediately after numeric literal

I gave up and just went the AJAX route via JQuery. Inline PHP inside javascript works fine in native php and javascript but not in breezing forms not sure why

Please Log in or Create an account to join the conversation.

Last edit: Post by shinzan.

Load PHP inside init script (php inside javascript) 6 days 17 hours ago #260351

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 6086
  • Karma: 3
  • Thanks: 429
Hi,

yes, with ajax it works ok.

If I find useful info, I will come back to you

Regards,
Tihana

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.047 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!