Call a javascript file from php




















The list of items is generated on the fly from the database, and the id attribute is generated based on the record id:. In the meantime, I've tried this:.

But of course this doesn't work because PHP is a server side action and JavaScript is a client side action. My particular problem is different enough from this one to leave me stumped. What's not clear is how to call the function on the file using AJAX. Yes, you have to call your PHP file as you mentioned. Javascript does the work of creating elements for displaying and entering data. Example 1: Injecting ajax response data directly into the DOM. John English John English 1 1 gold badge 5 5 silver badges 12 12 bronze badges.

Add a comment. Active Oldest Votes. Grant Thomas Grant Thomas 43k 9 9 gold badges 81 81 silver badges bronze badges. Miro Markaravanes Miro Markaravanes 3, 22 22 silver badges 32 32 bronze badges.

The Overflow Blog. Podcast Making Agile work for data science. Stack Gives Back Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually. Linked 4. Related Hot Network Questions. Stack Overflow works best with JavaScript enabled. Accept all cookies Customize settings.



0コメント

  • 1000 / 1000