Date:  04/27/2018 05:48:59 AM Msg ID:  004938
From:  Joe Goldsmiith Thread:  004938
Subject:  Calling Javascript Function
<p>
&nbsp;I&rsquo;m creating an app where a user registers to use the app. Once registration is complete an email is sent to user to verify registration. A link in the email send user back to app to verify their registration.<span style="font-size: 10pt">&nbsp;</span>
</p>
<p>
It seems in this case a browser tab already is open with app where registration information is entered and a new browser tab is opened when user clicks on the email link to reach the verification page. Now I have two browser tabs open showing the same app, but different pages.
</p>
<p>
What I am thinking to do is to close the browser tab with the registration page once user submits their registration. Then, when user clicks on the email link a new browser tab is opened verifying the registration then with full access to the whole app.
</p>
<p>
I was thinking about using the javascript below:
</p>
<p>
&nbsp;<span style="background-color: #ffff00"><span style="font-family: Monaco; font-size: 16px; -webkit-font-kerning: none; color: #0077aa">function</span><span style="font-family: Monaco; font-size: 16px; -webkit-font-kerning: none; color: #333333"> </span><span style="color: #dd4a68; font-family: Monaco; font-size: 16px; -webkit-font-kerning: none">closeCurrentWindow</span><span style="font-family: Monaco; font-size: 16px; -webkit-font-kerning: none; color: #999999">()</span><span style="font-family: Monaco; font-size: 16px; -webkit-font-kerning: none; color: #333333"> </span><span style="font-family: Monaco; font-size: 16px; -webkit-font-kerning: none; color: #999999">{</span></span>
</p>
<p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: Monaco; color: #333333">
<span style="background-color: #ffff00"><span style="-webkit-font-kerning: none">&nbsp; window</span><span style="-webkit-font-kerning: none; color: #999999">.</span><span style="-webkit-font-kerning: none; color: #dd4a68">close</span><span style="-webkit-font-kerning: none; color: #999999">();</span></span>
</p>
<p style="margin: 0px; font-stretch: normal; font-size: 16px; line-height: normal; font-family: Monaco; color: #999999">
<span style="-webkit-font-kerning: none; background-color: #ffff00">}</span>
</p>
<p>
&nbsp;I this case, once user submits the registration form, the form goes back to the top of the page and validates entered information and stores information in a table. Following that, an email is sent for user to verify registration. Below that I want to close the tab.&nbsp;
</p>
<p>
Following the storing of data I want to call the CloseCurrentWindow() function. Anyone know how to do this? Or, would anyone know a better way to validate a registration without having two open browser tabs having the same app running? Basically, it seems awkward to have user have to close one tab so as not to have two instances (tabs) of the app.
</p>
<p>
&nbsp;
</p>
<p>
Joe&nbsp;
</p>