Jump to content
View in the app

A better way to browse. Learn more.

The Uniform Server Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

responceText include js.php file printed out

Featured Replies

Hello gang,

I've been struggling for a week to get the Ajax called elements to run the external.js file script. I used get elementbyid to place an src on a blank script tag with a function that calls the Ajax call that works and alters the innerHTML of the correct div on my index.html but can't run the js on those new well styled elements unless I hardcode the events into the get.php? :) So I tried creating an include 'js.php' at the bottom of the get.php but only resulted in the js.php being printed out at the bottom of the responceText. Can anybody tell me if the UniServer php INI needs to be adjusted to parse js.php files differently in order to run javascript on responceText html elements? Or do I have to hard code/inline the events on the get.php file. Which does seem to work but is nonobtrusive to say the least? Any comments greatly appreciated. ;)

javascript is parsed by the browser and php by the server - the php server parses the php code and returns the result to the web server which passes it to the browser and then the browser handles the html, js, css client side

  • Author

javascript is parsed by the browser and php by the server - the php server parses the php code and returns the result to the web server which passes it to the browser and then the browser handles the html, js, css client side

 

megan Thanks I guess your telling me that I have to hard code the javascript events like onclick into the get.php file in order for the javascript to run which I have done like this and works:

 

get.php

echo "<img src='" . $row['src'] . "' class='image' [b][u]onclick='pictureclick()'[/u] [/b]  title='Click to get a better look'/></div>";

 

Is this the only way to get this to work? ;) It is obtrusive

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.