Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

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.

Ajax/Jquery problem

Featured Replies

I hope this is the right forum for this problem. I assumed it was since this seems to be the place for Javascript.

 

The basic idea behind what I'd like to do for my site is create a parent page ("parent.php" for this example) that has within it an ajax call to display another page (within a <div id="ajax"></div>). I want to make the page displayed within the div to be one of 2 choices, based on perhaps a php bool variable called "$logged_in". If false, it will display "login.php" and if true, it'll display "profile.php".

 

I think I should be able to figure that out on my own. The part I'm not sure what to do is make it so that "login.php" can trigger an event, like when the user successfully logs in, to change value of $logged_in to true and change the contents of the the div to "profile.php" dynamically.

 

Any help would be greatly appreciated. Thank you.

By using cookies you can set those params, if your looking for a complete solution, I don't have the time to provide its best start work on one you found then run you actually run into the problems with the code, include the snippet.

 

If you have done this already, please provide the code.

 

Thanks.

Create an account or sign in to comment

Account

Navigation

Search

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.