Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Very basic Javascript questionVery basic Javascript question
Previous
 
Next
New Post
1/13/2009 9:19 AM
 

This is so basic that I'd rather not ask but I've searched the forums and have only found more complex javascripting questions.  I'd like to create a popup window that opens when the page launches.  The way that I previously got this to work was like this:

<body onload=" pop();">
<Script>
function pop() {
myPopupWin = window.open('http://MySite.com/MyPopupPage','mywin','height=400,width=550,status=yes,toolbar=no,menubar=no,location=no');
myPopupWin.moveTo(300, 300);
}
</script>
</body>

I'm new to DNN and not sure how to put this javascript code in a body tag on DNN like I used to do.  There may be another/better way to do this type of javascripting in DNN and I would appreciate the direction.

 
New Post
1/13/2009 3:17 PM
 

Hi, TSD-

Adding JavaScript in DNN can get hairy since it's not always apparent which modules will load and execute scripts.  The most reliable approach is to insure that your scripts wait until everything is loaded before executing.  This is what you're already trying to do with your "body onload" event.

For DNN, instead of trying to modify the dynamically-generated BODY tag, I've found that using JavaScript closure works just as well and can be utilized anywhere on a DNN page without regard to other modules/content.

See this post for an explanation and a short example of adding page load events using closure:
 
  http://www.eguanasolutions.com/DNN_Blog/EntryID/4.aspx

 
Cheers!
-mamlin


esmamlin atxgeek.me
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Very basic Javascript questionVery basic Javascript question


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out