This topic is locked
[SOLVED]

  Displaying A Page In Popup Window Problem

4/27/2013 10:23:59 AM
ASPRunnerPro General questions
G
gdmacdo author

I am trying to test the popup mentioned in the new blog article http://xlinesoft.com...a-popup-window/ and I cannot seem to get it working. I have also posted to my demo account.
I have a myscripts.js in the root of the web site (I changed login.php to menu.asp in the params url section).
I have <script src="myscripts.js" type="text/javascript"></script> just before the </head> in my page.
I have <span id='username'><a href='#' onclick='login();'>Sign in</a></span> in my web page.
I am just trying to test the popup, without any extra code, and nothing happens. I disabled popup blockers just in case. Nothing happens in either Chrome or IE. Any thoughts? I am sure I am missing something simple. Below is the code:
***myscripts.js:
function displayPopup(params)

{

var pageid=1;

var pageObj = Runner.pages.PageManager.getById(pageid);

args = {

bodyContent: "",

footerContent: "<span>&nbsp;</span>",

headerContent: params.headerContent,

centered: true,

render: true,

width: params.width ? params.width : 450,

height: params.height ? params.height : 315

},

afterCreateHandler = function(win) {

var bodyNode = $(win.bodyNode.getDOMNode()),

iframeNode = $("iframe#popupIframe" + pageid, bodyNode);
iframeNode.load(function() {

if (Runner.isChrome) {

bodyNode.addClass("noScrollBar");

}

win.show();
}).attr("src", params.url);

},

afterCloseHandler = params.afterClose;
if (Runner.isChrome) {

$("

<style type='text/css'>; .yui3-widget-bd::-webkit-scrollbar { display:none;} </style>
").appendTo("head");

}

Runner.pages.PageManager.createFlyWin.call(pageObj, args, true,

afterCreateHandler, afterCloseHandler);

}
function login()

{
params = {

url: 'menu.asp',

afterClose: function(win) {

win.destroy(true);

},

headerContent: 'Login'

};

displayPopup(params);

}





**
Referencing Javascript in TestTable_add.asp

<!DOCTYPE html>

<HTML {$html_attrs}><HEAD><TITLE>{$pagetitle}</TITLE>

<META content=IE=7 http-equiv=X-UA-Compatible>

<META content="text/html; charset=utf-8" http-equiv=Content-Type><LINK rel=stylesheet type=text/css href="styles/default.css">{BEGIN rtlCSS}<LINK rel=stylesheet type=text/css href="styles/defaultRTL.css">{END rtlCSS}{BEGIN styleCSSFiles}<LINK rel=stylesheet type=text/css href="{$stylepath}">{END styleCSSFiles}{BEGIN pageCSSFiles}<LINK rel=stylesheet type=text/css href="{$pagestylepath}">{END pageCSSFiles}<!--[if IE]><LINK rel=stylesheet type=text/css href="styles/defaultIE.css">{BEGIN IEcssFiles}<LINK rel=stylesheet type=text/css href="{$stylepathIE}">{END IEcssFiles}<![endif]-->

<META name=GENERATOR content="MSHTML 10.00.9200.16540">
<script src="myscripts.js" type="text/javascript"></script></HEAD>

<BODY class="{$stylename}" {$bodyattrs}>{BEGIN body}{$header}
**
Link in TestTable_add.asp

{BEGIN Category_fieldblock}<TR class="runner-row style1 runner-b-addfields">

<TD class=runner-cl></TD>

<TD class="runner-cc runner-cc1">
<DIV class="fieldlabel_Category {$fielddispclass_Category}">{BEGIN Category_label}Category {END Category_label}</DIV>

<DIV class="fieldlabel_Category {$fielddispclass_Category}">{BEGIN Category_label}&nbsp;{END Category_label}</DIV>
<span id='username'><a href='#' onclick='login();'>Sign in</a></span**></TD>

<TD class="runner-cc alt runner-fixedcell">
<DIV

class="fieldcontrol_Category {$fielddispclass_Category}">{$Category_editcontrol}&nbsp;

</DIV></TD>

<TD class="runner-cr alt"></TD></TR>

{END Category_fieldblock}

Sergey Kornilov admin 4/27/2013

The arroach looks correct. It might be just a mistype but it appears that file name is myscripts.js while you are trying to include myscript.js.
As a rule of thumb - turn on Developers console in Chrome to see if there are any Javascript errors there. It will show you if any files referenced on there page were loaded or not.
The following article provides more troubleshooting tips:

http://xlinesoft.com/blog/2012/05/22/how-to-troubleshoot-javascript-errors/

G
gdmacdo author 4/28/2013

It is actually myscripts.js in the include. Sorry, that was a typo in forum text. I will go back and edit my post to reflect the actual name.
Any suggestions why it doesn't work?




The arroach looks correct. It might be just a mistype but it appears that file name is myscripts.js while you are trying to include myscript.js.
As a rule of thumb - turn on Developers console in Chrome to see if there are any Javascript errors there. It will show you if any files referenced on there page were loaded or not.
The following article provides more troubleshooting tips:

http://xlinesoft.com...ascript-errors/

Sergey Kornilov admin 4/29/2013

You can post it to demo account and I'll take a look.

Sergey Kornilov admin 4/29/2013

I can see your project on Demo Account. I would ask you to uncheck 'Compress Javascript files' option on Output directory screen, perform a full build and then upload it one more time. Open a ticket at http://support.xlinesoft.com sending your Demo Account URL once done.

G
gdmacdo author 4/30/2013

Per support, "

[color=#222222]

S
solosoftware 5/5/2013

Thanks Greg Mac.
It's great forums members coming back after going to support or posting on the demo account and saying what worked for them to fix the issue.