htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 3 (beta): htmlArea 2 & 3 archive (read only): htmlArea v3.0 - Discussion:
Insert Javascript for a pop-up


The htmlArea 2 & 3 editors have been discontinued.

We've made these forums available as a read-only reference and knowledge-base for people using or developing editors based on htmlArea 2 or 3.

Anyone who is interested in taking over version 2 or 3 is free to do so. All we ask is that you choose a new name that doesn't have "htmlarea" in it to avoid confusion with this site. We'll even give you a link in the directory to make it easier for people to find you. If you are developing or hosting an htmlArea based-editor under a new name, please submit it to our directory.

 


sebiv
New User

Aug 18, 2004, 8:55 AM

Post #1 of 2 (3003 views)
Shortcut
Insert Javascript for a pop-up Can't Post

Hi !!

I want to insert a javascript code (directly on html in "view source" of htmlaera).. but some problem..

How can we insert a this javascript ? some one have an example ?

Thx

Seb


drummer
Novice

Feb 9, 2005, 5:30 AM

Post #2 of 2 (2889 views)
Shortcut
Re: [sebiv] Insert Javascript for a pop-up [In reply to] Can't Post

Hello!

I use this code (an example):

<a href="javascript:viewer('http://www.yoursite.se/viewer.php?name=bildspel&lang=1','bildspel','400','300','no','center');">Öppna bildspel<br /></a>

In the "lnsert Web Link" i paste
javascript:viewer('http://www.yoursite.se/viewer.php?name=bildspel&lang=1','bildspel','400','300','no','center');

and then for it to work I put this code in an external js-file:

Code
<!-- 
var win=null;
function viewer(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=0}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}
//-->

Its not as easy as just make an regular link but if you want to do pop-ups this is a way of doing it.
If someone else have an easier way I sure would like to know about it, for example if there is an way of just inserting width and height and the name of the page?

///E

 
 
 


Search for (options)