Call Javascript Function from seperate Classic ASP page

burak1000

New Member
I'm updating a Classic ASP page (login.asp) which includes another Classic ASP Page (logincode.asp -- contains functions for the first page). Previously, after clicking the login button, it would run several functions on logincode.asp and then open a terms agreement dialog if needed ... \[code\]If Not Application("RequireTermsAcceptance") Then Response.Redirect(redirectURL)Else response.Write("<script>$(function () {displayTerms();});</script>")End If\[/code\]... and this worked by calling a Javascript function on login.asp\[code\]<script>function displayTerms() { //open Dialog box here }</script>\[/code\]The Dialog box has two buttons ... one which passes them to the next page upon agreement, or the other which returns them to login.asp.However, the new setup doesn't want to go to the function properly any longer.There are several possible reasons for this ...[*]using a newer version of jquery ui ... jqueryui/1.8.8/jquery-ui.min.js - on the old ... jquery-ui-1.8.16.custom.min.js on the new.[*]The old one didn't build the jquery UI dialog box until you called the displayTerms function. The new one builds the jquery UI dialog in $(document).ready(function () but is hidden until the displayTerms function is called.[*]The displayTerms function is in the wrong location. Currently on the new version it's inside the $(document).ready(function () section. But I'm not sure that's the correct location. I'm not familiar enough with javascript syntax to know how the call to the displayTerms function needs to change, but it still needs to be in a response.Write I believe. Currently, the code executes all the way through, but when it gets to the response.Write that should call the displayTerms function, it hits it, passes it and then simply reloads the login.asp page.Any Suggestions on how this should work would be appreciated. If you need any further detail, please let me know and I'll be happy to provide it.
 
Back
Top