Window.showModalDialog For Mozilla

Dec 7, 2003

Somewhat tested on Moz1.5


<html>
<head>
<script language="JavaScript1.2" type="text/javascript">

/*
Notes:
1. edge & help attributes do not work.
2. "height" & "width" must be entered before "center"
3. if you should choose to set "center=yes" do not put in "left" and "top"
4. Minimize button not hidden, but when clicked the window will not disappear
5. Aside from the aforementioned, all features should react the same *fingers crossed*
6. Still in the works, so don't expect miracles. Any problems/queries/complaints please don't hesitate.
Email:
x_goose_x@hotmail.com
*/

dFeatures = 'dialogHeight: 450px; dialogWidth: 1049px; dialogTop: 646px; dialogLeft: 4px; edge: Raised; center: Yes; help: Yes; resizable: Yes; status: Yes;'//default features

modalWin = "";
function xShowModalDialog( sURL, vArguments, sFeatures )
{
if (sURL==null||sURL=='')
{
alert ("Invalid URL input.");
return false;
}
if (vArguments==null||vArguments=='')
{
vArguments=''
}
if (sFeatures==null||sFeatures=='')
{
sFeatures=dFeatures;
}
if (window.navigator.appVersion.indexOf("MSIE")!=-1)
{
window.showModalDialog ( sURL, vArguments, sFeatures );
return false;
}
sFeatures = sFeatures.replace(/ /gi,'');
aFeatures = sFeatures.split(";");
sWinFeat = "directories=0,menubar=0,titlebar=0,toolbar=0,";
for ( x in aFeatures )
{
aTmp = aFeatures[x].split(":");
sKey = aTmp[0].toLowerCase();
sVal = aTmp[1];
switch (sKey)
{
case "dialogheight":
sWinFeat += "height="+sVal+",";
pHeight = sVal;
break;
case "dialogwidth":
sWinFeat += "width="+sVal+",";
pWidth = sVal;
break;
case "dialogtop":
sWinFeat += "screenY="+sVal+",";
break;
case "dialogleft":
sWinFeat += "screenX="+sVal+",";
break;
case "resizable":
sWinFeat += "resizable="+sVal+",";
break;
case "status":
sWinFeat += "status="+sVal+",";
break;
case "center":
if ( sVal.toLowerCase() == "yes" )
{
sWinFeat += "screenY="+((screen.availHeight-pHeight)/2)+",";
sWinFeat += "screenX="+((screen.availWidth-pWidth)/2)+",";
}
break;
}
}
modalWin=window.open(String(sURL),"",sWinFeat);
if (vArguments!=null&&vArguments!='')
{
modalWin.dialogArguments=vArguments;
}
}

function checkFocus()
{
if (window.navigator.appVersion.indexOf("MSIE")==-1)
{
if (modalWin!=null && !modalWin.closed)
{
self.blur();
modalWin.focus();
}
}
}

</script>

</head>
<body onFocus="checkFocus();">
<br>
<br>
<input type="button" onclick="javascript:xShowModalDialog('test.htm',this,'');" value="click">
</body>
</html>

View 3 Replies


ADVERTISEMENT

ShowModalDialog - Window Size

Sep 13, 2006

Its the first time Ive used the showModalDialog function and was wondering how best to size the dialog to compensate for the window borders.

My command looks a bit like this:

500px; dialogWidth: 700px; dialogTop: 150px; dialogLeft: 150px; edge: Raised; center: No; help: No; scroll: No; status: Yes;")'

While I set the width and height to 700 and 500 respectively, the internal size of the window.document object comes out to be 694 and 448.

View 9 Replies View Related

Fixed: Window.showModalDialog And Popup Blockers

Aug 15, 2007

I created a little script on a section of a website that password protects the page. It gives a user 3 tries to enter the correct password and then if they get it wrong, it moves them to another page that says they don't have access.

Recently, I upgraded it to do a window.showModalDialog instead of just using a plain javascript prompt as they don't look as nice and clear as a customized JSP could.

However, now that we've sent that upgrade out, we're finding that some of our users are not seeing the window.showModalDialog and it just loads the page (not the no access page).

The script is below. When I look through it, it looks to me that a user with an active popup blocker should just be sent straight to the no_access.jsp file, but that isn't what's happening. Code:

View 2 Replies View Related

Replacement For ShowModalDialog - Disallow Anyone To Browse From A Pop-up Window Without Closing It

Jul 17, 2008

I was trying to find a browser independent way to raise a modal dialog. I know that MS IE has showModalDialog and Firefox has an attribute modal for window.open but I was wondering if anyone knew of a solution out there that would disallow anyone to browse from a pop-up window without closing it. Disabling the text highlighting and right click are not required, just disabling the user from browsing with the dialog open.

View 4 Replies View Related

Window.open Does Not Work In Mozilla

Jul 23, 2005

The following code used to popup a window when I used netscape 4.79.
Now I switched to mozilla 1.4 and the window doesn't popup.

function newWindow(newContent)
{
winContent =window.open(newContent,'nextWin','screenX=0,scree nY=20,width=600....);
winContent.focus();
}

....
<a href="javascript:newWindow('foo.html')"

View 3 Replies View Related

Window.close() And Mozilla/Netscape

Nov 24, 2005

I'm trying to make a link that closes the browser:

<a href="javascript:window.close()">CLOSE</a>

It works with IE6 but not with Mozilla and Netscape.
Does anybody knows the reason why?

View 7 Replies View Related

Replacement For Window.showmodelessdialog In Mozilla

Jan 17, 2006

what is the replacement for window.navigate in mozilla & i was used window.showmodelessdialog in IE5 - in mozilla it is not working

View 5 Replies View Related

Window.opener Not Working In Mozilla?

Nov 15, 2010

My parent window is dash.html. From this i call a pat.jsp file which is a child window to dash.html. I wrote a function in dash.html

function feed_refresh(){
getGlaceCompleteDashBoardResult(1);
}

this function getGlaceCompleteDashBoardResult(1); is included in a .js file in dash.html file. Now from the pat.jsp i call the feed_refresh() function on onunload=db_refreshfeed(); like this.

var db_refreshfeed = function(){
if(REQUEST_TYPE)
window.opener.feed_refresh();
}

This code working nice in IE but in mozilla it throws uncaught exception.

View 3 Replies View Related

Window.open Not Work In Mozilla?

Oct 4, 2003

I am trying to use the following javascript function to open a new window. It works fine for IE browsers, but not Mozilla.

settings = 'height='+screen.height+',width='+screen.width+',top=0,left=0,scrollbars=yes,directories=no,location=yes,menubar=yes,resizable=yes,status=yes,toolbar=yes'
win = window.open(address, "newwindow", settings);
Am I doing something wrong or does Mozilla not support the window.open function? Or is it something in the settings thats breaking it?

View 9 Replies View Related

IE Versus Mozilla [window.open]

Feb 6, 2006

I've got this popup-Javascript, which works perfectly fine in Firefox, but does nothing in IE for Windows. Code:

View 3 Replies View Related

Window.status Not Work With Mozilla Firefox?

Apr 15, 2008

I have a link

<a href="#" onclick="popup()" onMouseOver="window.status='http://www.google.com'; return true">Click here</a>

I want to open popup on clicking link and onmouseover the link i want to show url in status bar .if i give it in href then onclicking it open the new window and submit the parent window

i use mouseover function to give status bar url it work in IE7 but not in mozilla

View 11 Replies View Related

Close Child Window In Mozilla Browser?

Jan 14, 2009

I am facing problem while closing the child window in Mozilla Browser. Actually i am using window.close() in order to close the child winow . Its working fine with IE but its not working for Mozilla browser.

View 4 Replies View Related

Refresh ShowModalDialog

Jul 23, 2005

i am trying to refresh a ShowModalDialog that contains information. I have
search about it but it never seems to be possible. As anybody got some
info., way, idea, documentation about a ShowModalDialog refresh.

View 2 Replies View Related

ShowModalDialog(...) Problem

Sep 2, 2005

window.showModalDialog('myPage.xml','','help:No;status:No;resizable:Yes');

This code for some reason does not work.
If instead of myPage.xml I give it a URL or HTML page it works fine but not with xml page. Why?

View 6 Replies View Related

When The Images Rotate In Mozilla In Between The Rotations, Mozilla Browser Adds A Little Colored Square That Represents A Blank Image?

Jul 16, 2009

had this in browsers areas but people told me I should put it here in Javascript because more people here would probably have seen it before and know why it happens. I have basic Javascript that rotates images. I've noticed any kind of Javascript code that rotates images has this same problem only in Mozilla. When the images rotate in Mozilla in between the rotations, Mozilla browser adds a little colored square that represents a blank image that are able to be seen does anyone know why Mozilla Browser adds that? For example when looking at this page in Mozilla can see it. if you know if this is some Mozilla problem with Javascript and images. Doesn't happen with IE and other browsers shows the images only and nothing else.

View 2 Replies View Related

Sleep() Function - ShowModalDialog In Firefox?

Jan 4, 2006

From some examples, I created a sleep() function which can put a javascript into sleep while it is executing. It is using the IE-only function showModalDialog. Does anybody know a function which does the same in Firefox and other browsers, or a function which also stops the execution of a script temporary?

This is what I got so far:

View 2 Replies View Related

Call A Method In Parent Object From A ShowModalDialog?

Oct 13, 2011

I have defined a method in an iframe named as refresh1().In the iframe we are showing records in a table.on clicking a record of table or you can say row a showmodal Dialog object will open which shows the info of clicked record.I want to call refresh1() method onclick of save button whic is defined in modal dialog.I have triedparent.window.dialogArguments.refresh1() but it is not workin.

View 2 Replies View Related

ShowModalDialog And Loading DOMDocument Synchronously Causing Error.

Jul 23, 2005

I am using the following code in the button_click event in xxxxx.htm
page which is URL for the showModalDialog window.

function btnAddComment_Onclick()
{
var user_info = new ActiveXObject("Msxml2.DOMDocument");
user_info.async = false; *****causing the error.
user_info.load("../xml/userinfo.aspx");
}

user_info.asyc = false is throwing the error (Object doesnt support the
method or property. Do you want to debug?) This is happening only on
the production region and after I choose not to debug and click on the
button once again it is working fine.

View 2 Replies View Related

Porting App To Mozilla - Work On Both IE/Mozilla ?

Nov 30, 2010

I've a BIG Problem With a HUGE JS application , i'm modifying its javaScript code to work on both IE/Mozilla , currently it works fine on IE but not on Mozilla.

My main Point now is events.

Lets try with a little module, consider this function :

And it is attached in this place like :

This works fine in IE , i want to modify it to work on Mozilla.

View 2 Replies View Related

Mozilla And DOM

Oct 29, 2006

I have an 'input' that is of type= "image", and name="butt",
that I need to enable/disable from time to time.

In IE (6) I used [document.theform..butt.disabled=condition] and it worked
fine. However, in a Mozilla (latest vers, no number avail) it doesn't see
this as an object. As a workaround I declared a global var 'theButton' and
used 'onLoad="theButton=this;"' within that 'input' to set the value, and
this works fine in both Moz & IE.

Having to use a global var is not a problem, but I would like to know why
the original attempt didn't work in both browsers? The 'form' that 'butt'
is a member of contains 1 select, 3 type="text" inputs, and finaly the
type="image" input.

Perhaps Moz doesn't add an 'input' of type="image" to the collection if the
types are mixed?

View 4 Replies View Related

Ns4,6,ie5,6 And Mozilla

Jul 20, 2005

I have this script and I want to adapt it to the DOM of most / all well
known browsers like mozilla and netscape.. at the moment it only works in
ie4+ en ns6. can anybody give me some hints?
This is used for making a tree <li><ul>

var ns6 = document.getElementById && !document.all;
var ie4 = document.all && navigator.userAgent.indexOf("Opera") == -1;

function checkcontained(e)
{
var iscontained = 0;
cur = ns6 ? e.target : event.srcElement;
if (cur.id == "foldheader")
{
iscontained = 1;
}
else
{
while (ns6 && cur.parentNode || (ie4 && cur.parentElement))
{
if (cur.id == "foldheader" || cur.id == "foldinglist")
{
iscontained = (cur.id == "foldheader") ? 1 : 0;
break;
}
cur = ns6 ? cur.parentNode : cur.parentElement;
}
}
if (iscontained)
{
var foldercontent = ns6 ? cur.nextSibling.nextSibling :
cur.all.tags("UL")[0];
if (foldercontent.style.display == "none")
{
foldercontent.style.display = "";
cur.style.listStyleImage = "url(images/open.gif)";
}
else
{
foldercontent.style.display = "none";
cur.style.listStyleImage = "url(images/fold.gif)";
}
}
}

if (ie4 || ns6)
{
document.onclick = checkcontained;
}

View 6 Replies View Related

This Works In IE But Not In Mozilla

Jul 23, 2005

I have some functions in a script in which I'm manipulating the
innerText and background colors of certain rows in a table. The lines
below work OK in IE but when I try them in Mozilla, I get an error
that says: "document.getElementById('TableX').rows is not a
function".

thisRow = document.getElementById('TableX').rows(1);
thisRow.style.background = 'white'

Can anyone give me a clue as to how to fix this so that it will work
in both browsers?

View 2 Replies View Related

XmlHttp With Mozilla?

Jul 23, 2005

anyone have a code example of using xmlhttp with mozilla, if i use the
following code, the function is never called, but it does work in IE.

xmlhttp.
{

if (xmlhttp.readyState == 4)
{
var response = xmlhttp.responseText;
divResponse.innerHTML += "<p>" + response + "</p>";
}
}

View 3 Replies View Related

How Disable The F5 Key In Mozilla

May 24, 2006

I am trying to disable the F5 key in Mozilla. I have the next code in
javascript that it is working in Internet Explorer but it is not
working in Mozilla. how can I disable the F5 key in Mozilla?

<script>
document.onkeydown = function(){

if(window.event && window.event.keyCode == 116){
window.event.keyCode = 505;
}
if(window.event && window.event.keyCode == 505){
return false;
}

}

</script>

View 7 Replies View Related

Mozilla DOM Element

Jul 3, 2006

I have a function which dynamically adds to a table. It receives a
variable which basically encapsulates this:

<div id="tableid">
<tr>
<td>col1</td>
<td>col2</td>
...
</tr>
...
</div>

It's worth nothing that the incoming variable is a product of XSLT
transformation, so I think it's technically an XML DOM element
(although I'm not too sure on the difference between the XML DOM and
the HTML DOM).

On the incoming variable, I do getElementsByTagName("tr") and -("td")
to get NodeLists of the rows and columns respectively. To insert them
into the table, I create new tr and td elements, then copy the value
over, like this:

//stuff to get a column
trs = getElementsByTagName("tr");
tds = trs[i].getElementsByTagName("td");
thiscol = tds[j];

//stuff to copy the column value
new_tr = document.createElement("tr");
new_td = document.createElement("td");
new_td.innerHTML = thiscol.xml

The .xml part is a Microsoft creation, so the only works in Internet
Explorer. In anything else the column value is rendered as 'undefined'.

I'm trying to make things work in Mozilla too, but an Element node
(thiscol.nodeType gives me &#391;') doesn't have nodeValue implemented.
InnerHTML and OuterHTML are not implemented either.

How on earth are you supposed to extract a value from an XML node if
nodeValue is not defined? Am I going about things in the wrong way?

View 8 Replies View Related

DOM Problem In Mozilla

Jul 19, 2006

I am facing problem with updating form element using javascript in
MOZILLA Details are as follows.

I have a div containing form element. on submit , i am submitting the
form using javascript-ajax and processing the form. then after
successfully processing i am replacing innerHTML of div with same
form. I am able to see same form on page after ajax update but when i
refill the form and submit it again..javascript is not able to find the
form element in HTML DOM.

This problem comes with mozilla-firefox but it works fine with IE 6 ...

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved