jQuery SimpleModal view once using a cookie - cookies

I am new to javascript and jQuery. I am using SimpleModal basic to display a message onload when a user visits my site. It's working great, but it repeats each time I visit the page I installed the script. I need this message to be viewed once for the session.
I have searched all over the internet, and have seen that this can be taken care of using a cookie, but I'm not sure of how to tie the cookie function into the function of the modal script.
How can I implement a cookie to track the modal function, and display it only once when the page loads?
Here is the script that loads the modal content:
jQuery(function ($) {
// Load dialog on page load
$('#basic-modal-content').modal();
});
Thanks for your help!

Related

How to detect a page refresh using javascript on APEX?

My goal is to do some javascript action the moment the user clicks the browser's refresh button.
I've tried:
Function and Global Variable Declaration
function pageunload(){
alert('here');
};
Execute when Page Loads
window.addEventListener('beforeunload', pageunload);
I know that the 'addEventListener' is working properly but the event is not the right one.
I have also tried to dynamic action "before Refresh", but I haven't been able to associate it to the page level, only items/regions etc.
In the page attribute you can write Javascript on Page Load which will be executed when the page is reloaded or submitted.
beforeunload is the opposite of what you want
Use the load event
Check Mohamad image
Create a dynamic action for page Load

Oracle-Apex: Dynamically redirecting from login button

The scenario
I have implemented social authentication similarly to described by Dimitri Gielisin hist post "Facebook, Google and Custom Authentication in the same Oracle APEX 18.1 app" (http://dgielis.blogspot.com/2018/06/facebook-google-and-custom.html)
The pertinent point is that there is a button which has the request 'APEX_AUTHENICATION=FACEBOOK' which logs the user in and also hard codes the page that the user is taken to.
It works great. (However if I have a login menu item which directs back to the same page - the user name isn't updated on the page.)
The Issue
Default behaviour is for apex to redirect users to the login page when they attempt to access a page which is not publicly available.  After logging in the user is taken to the page hard coded page in the button (except for modal dialogues which just produce an invalid session error). 
I'd love it if they could sign in and then continue to the page they need to go to. Is there some not extremely cumbersome ways of doing that? I thought of trying to saving the page number I want the user to go to into an application item and then having the button redirecting based on the application item- but while I was saving the page number the dynamic redirect in the button is not working...and I feel like I'm fighting the apex framework...
Is there a better way? If not can a button reference an item for the page number? I was trying &APP_ITEM. but that didn't seem to work...
(I"m using Apex 20.1)

How to handle bootstrap button without any href in Jmeter?

Im trying to test performance for a web app and I'm currently blocked on a page which has submit button without any hyperlink.
How do I navigate to the next page?
This is the button im trying to use to navigate to the next page: Next
I tried using the CSS selection extractor in Jmeter, its reading the value of the button(I can see in the debug sampler) but without any hyperlink im unable to use that as a path for navigating to next page. Debug Sampler
Jmeter (not webdriver sampler) works on request level and not on gui level. So, you need to capture the request to navigates to the next page and not to click on the button.
Try jmeter recording. or directly put the path of the landing page in a new http sampler manually.
Hope this helps.

What is the simplest way to create a page tab on the latest version of fb?

All I want to do is create a few pages with sign up forms for our fans and customers on our business facebook page.
I created the new app, named it and went on to the basic settings. From what I can tell I just need to set up the "page tab" info. I Named the tab, put in the page tab url, secure page tab url and uploaded a tab image.
Then I wait for it to show up on our fb page. I refresh the page and for a few seconds it looks like something is being loaded in the list of tabs. But then it stops and the layout of default tabs (photos, likes, and events) are unchanged.
The tab should link to the app url which should load inside of an iframe which will have the html from our web server.
That's how I understand it anyways.
You must add manually the application on your page through this URL: http://www.facebook.com/dialog/pagetab?app_id=APP_ID&redirect_uri=https://www.facebook.com/
Remember to replace APP_ID first.

django login popup

I've been trying to figure out how to do a modal login in django and have been having some trouble. Is this possible? It seems like it should be. I imagine the solution involves writing a view that takes a POST request and returns some JSON.
Are there any examples out there of how to do this in a clean way?
The easiest way I've found is to do the following:
Write a simple standalone login view
Display this view on your pages as an iframe using a javascript modal dialog (I recommend Colorbox).
Because you're displaying an iframe, you don't have to worry about ajax sends etc. The iframe can just post data and redirect normally.
On a successful login, redirect the iframe to a 'success' page. After a few seconds, have that page send a message to the parent window, which can then close the modal box and make any necessary changes to itself.