Window.open Not Setting Attributes Correctly?

Aug 17, 2010

I'm using window.open to open to display some info in a new window. The info displays correctly, but the resizeable, scrollbars, width, and height attributes don't seem to be setting correctly. The window isn't resizeable, and the width/height is way off.

Code:
window.open(windowURL, "_blank", "location=0,status=1,scrollbars=1,resizeable=yes,width=500,height=600");

View 1 Replies


ADVERTISEMENT

Setting The Page Title Of Chrome Window.open?

Feb 14, 2011

I have some JavaScript that is being used to open a new window and display a PDF file. This is working fine apart from the title of the new window being open. I am using the window.open function and I have set the title of the page using the document.write function (see code below). The code works fine for FF and IE but for some reason Google Chrome just displays 'Untitled - Google Chrome'

<body>
<a href="javascript:openNewWindow();">Click Here</a>
<script type="text/javascript">
function openNewWindow()

[Code]....

Note: I have also tried adding - pdfWindow.document.title="Title"; - to the JavaScript, with no luck.

Is there anything specific that is required for Chrome or am I just missing something??

View 1 Replies View Related

Setting Table Cell Style Attributes

Jun 19, 2007

given a cell from a table...
function Tbl_GetCell(tbl, row, col)
{
var theRow = tbl.getElementsByTagName("tr")[row];
return theRow.getElementsByTagName("td")[col];
}

I can set attributes like width, height, and align, but how can I set cell style info?

cell = GetCell(tbl,row,col)
these work fine... cell.align = "center"; cell.height = 22;
but this doesn't... cell.style = "font-weight: bold; text-decoration: blink"

View 2 Replies View Related

JQuery :: Appending, Setting Attributes, Text To An XML DOM Object?

Oct 8, 2010

I am having an issue appending, setting attributes, text on the root node. Below is a sample of the code that performs this task (nLevel, nID, and sText are variables passed in by the containing function. XMLDOM is an XML DOMDocument object:

[Code]...

View 2 Replies View Related

JQuery :: Creating Elements And Setting Attributes With Namespace

Mar 7, 2011

I'm working on an app, which createsvisualizations based on SVG. I was using jQuery SVG by Keith Wood at first [URL], but at some point I've noticed that it's very inconvenient for some stuff and wrote my own functions to handle everything. One of the quirks when creating svg trees dynamically is that you have to create all elements and set attributes using the SVG namespace ("[URL]"), otherwise they aren't rendered correctly by browsers.

Here's an example of how you create a text element...
var svgns = "[URL]";
var newText = document.createElementNS(svgns,'text');
newText.setAttributeNS(null,"x","0");
newText.setAttributeNS(null,"y","0");
$(newText).text("some text");
$(svgGroup).append(newText);

There doesn't seem to be a way to do that more effectively using jQuery. For instance, you can't use attr to set multiple attributes, since it won't use setAttributeNS.

View 2 Replies View Related

JQuery :: Setting Multiple Attributes On Createdoesnt Work?

Aug 31, 2011

if a try this bit of code when dynamically creating a div - whole page fails - no action

<
g:javascript>
$(function () {alert ("page loaded");[code]....

View 1 Replies View Related

Code - Void Window.open - Link Would Open In The Same Window?

Feb 7, 2009

I have this piece of code which is opening link in new window:

How to change this code so link would open in the same window?

Probably I should change this part: javascript:void window.open

View 1 Replies View Related

Links That Uses Window.open Then Open A New Designated Window

Jan 17, 2012

I have a problem on the links on my page im working.sorry guys still a noob and my english is not that good. :b. my question is like i have a list of packages of food. [link_a] [link_b] [link_c] and i have a function that i put in my head tag:

function linkA()
{
window.open('link_a.html','link','width=300,height=200,resizable=yes');
}

now i can go to linka.html by click my link <A HREF="javascript:linkA()" >link a</A> is there a way i can have one functions that can open a link depend on what page .when it clicks then go to its designated page or i have to stick on writing function for linkB ,C,D and so on.

View 7 Replies View Related

Open A Link On The Same Window Using Window.open Or Any Other Method?

Oct 19, 2011

How to open a link on the same window using window.open or any other method in JavaScript.

View 2 Replies View Related

Child Window Close Event - Opening Another Link In A Separate Window Using Window.open()

Jan 29, 2010

I have a HTML and I am opening another link in a separate window using window.open() . The child window is something like 'http://yahoo.com' which is out side html. I need to refresh the parent window when the child window is closed.

View 4 Replies View Related

Changing Font Attributes In Pop Up Window?

May 14, 2009

I am using the JK Pop-up image viewer, from JavaScript Kit for an online library exhibition I am making. I can change the background color of the pop-up window to the color of the main website (Dark Blue) however, I can not seem to find away to change the color or font style, of the text that appears in the pop-up window.I have tried using css to no success, the only way I can seem to do it is by wrapping the text for each image in the deprecated <font color> tag which i obviously don't want to do.Here is the code below:

<script type="text/javascript">
// JK Pop up image viewer script- By JavaScriptKit.com
// Visit JavaScript Kit (http://javascriptkit.com)

[code]....

View 2 Replies View Related

Changing Attributes Of An Existing Window?

Nov 22, 2010

I'm not really much of a javascript programmer, but I occasionally use javascript that I've found here and there. But I'm unable to find anything that helps me in what I'm trying to do now.

I regularly use a snippet of code that pops up a small window to display an image or a very small html file.Using the window.open() function, I'm able to disable scrolling, resizing, etc., and size it to my needs. I'll have a window.close link somewhere on the page. But in my current project, my customer's page has several links related to other companies. When you click on the link, an that company's ad pops up in a small window. At this point, the viewer can simply close the window, or they should be able to click on the ad and be taken to that company's website.

I'm able to have it close the window and open that new url in the parent browser window, but my website customer doesn't want their site to go away. They want the new company's website in a new window.

Or I can simply NOT close the popup window, but now the new company's website is in a relatively small browser window, unable to scroll, resize, etc. Is there a way for me to somehow modify an existing window with an onclick directive - something similar to the window.open() function, OR open a new browser window with window.open() AND close the popup window? If I haven't made myself clear, let me know and I'll try to explain myself better.

View 2 Replies View Related

Open In New Browser Window (like With Target="_blank", Not Window.open)

Dec 1, 2011

Code: window.location but have it open in new browser window (like with target="_blank", not window.open)

View 7 Replies View Related

Thru Window.open Open A Word Document In Print Preview Mode

Jul 23, 2005

Through window.open or window.showmodaldialog, I want to open a word
or excel document in Print Preview mode. Bcos I don't want the user to
make any changes or save it but the user can ONLY VIEW OR take a print
out.

View 1 Replies View Related

Window.Open In FireFox - Click Very Quickly - Multiple Windows Open

Nov 16, 2009

I'm using an <A> tag with an onclick event to open a window with JS (window.open)... In FIREFOX, if I click very quickly, multiple windows open. Not a problem in IE.

View 8 Replies View Related

Window Doesn't Resize And None Of The Attributes Are Working?

Mar 25, 2009

this seems to work but the new window doesn't resize and none of the attributes are working?

<form name="login" action="secure/checkuser.php" method="post" target="mywindow" onsubmit="window.open('mywindow','width=400,height=300,toolbar=no,location=no,directories=no,status=no,menubar=no,titlebar=no,scrollbars=yes,copyhistory=yes,resizable=no')">

View 2 Replies View Related

JQuery :: Setting Image To Link To Itself And Open In Colorbox

Jul 20, 2011

I have an image that has been resized via CSS to show as 100x100px on an HTML page. When clicked, I want to open the image in a colorbox - so the user can see the non resized/squashed version as it will normally appear. I've worked out how to set the path of the href to itself (so this doesn't have to be changed every time) (see below), although not sure how to get the colorbox part working - I tried changing 'each' to 'colorbox' - as per how you would normally assign the colorbox, and it opens, it just doesn't load the image in it.

<div class="logoImage"><img src="../tym_img_shared/background-2.jpg" alt="Your company logo" /></div>
$(document).ready(function(){
$('div.logoImage img').each(function(){
var $this = $(this);
$this.wrap('<a href="' + $this.attr('src') + '"></a>');
});
});

Thinking about it, perhaps it would be easier to also set the 're' attribute of the link whist setting the source?
$(document).ready(function(){
$('div.logoImage img').each(function(){
var $this = $(this);
$this.wrap('<a rel="gallery" href="' + $this.attr('src') + '"></a>');
});
});
Doesn't work for some reason - but it does if I hardcode the URL and rel?

View 6 Replies View Related

Window.open - How To Open A Local File (xml) With Firefox

Apr 2, 2008

my file is located at c:AdminFiles.xml

i tried the following ways

window.open("c:/AdminFiles.xml",'HeavyXml');
window.open("c:AdminFiles.xml",'HeavyXml');
window.open("c:\AdminFiles.xml",'HeavyXml');

in the above i'm getting the following error: "Firefox doesn't know how to open this address, because the protocol (c) isnt associated with any program"

window.open("file:///c:\AdminFiles.xml",'HeavyXml');

the last attempt give to respond at all...

View 5 Replies View Related

JQuery :: Keeping Modal Dialog With Validated Form Open Until Form Is Filled Correctly?

Feb 7, 2011

I have a simple three-field form in a UI Dialog that, prior to POSTing, I need to validate using the jQuery Validation plugin.Currently, if the user clicks the form's Submit button (the form's action for the PHP form handling is the page with the link that opens the Dialog in the first place) with a field not properly filled out, the Dialog just closes.Clicking again on the link that opens the Dialog form will show the form with the error message(s) that the Validator generated on the previous click of the submit button.How can I keep the Dialog open and prevent a POST until the form validates?

View 1 Replies View Related

Window.open() Doesn't Open New Window In FF, Only New Tab

Feb 14, 2011

window.open() doesn't open an entirely new window in FF3.6, just a new tab

Edit: Yeah, ok, so if i specify a size smaller than the current standard window, it'll be forced to open a new window. but what if i want a new standard sized window to open entirely?

View 4 Replies View Related

Script To Close Old Window And Open New Window With New Link And Specific Size

Jan 29, 2006

I need a script that will open a new window (popup / new link) in a specific size, but will also close the old window (where the popup came from). I know the popup window is easy but finding a work-able close window script as the new window is opened is impossible!!

View 3 Replies View Related

Child Pop Up Race Condition Using Window.open Need To Detect Window.onload

Nov 22, 2011

I am trying to pop up a window and then do stuff(set flags) when the content of the new window is done loading. For this I am trying to detect the window.onload of the pop-up child window but so far I am unsuccessful. I believe my problem is that the URL of child window is on different domain, than the one of the opener(parent) so that the window.onload is not being called. Though this may change, at the moment I do not have access to the code for the page I'm opening up in the pop-up. Im pretty new to web development.

[Code]....

View 3 Replies View Related

Open A Popup Window From A PHP Site And Pass In Some Parameters To Use In The Pop Up Window

Sep 23, 2010

I need to open a popup window from a PHP site and pass in some parameters to use in the pop up window. I have the params in an input box and need to get the val of the box into a param and pass it to the new popup window. All pages are local and in the same folder. The id of the input box is 'ddutykey'. The name of the new window would be showduty.php if possible.

View 3 Replies View Related

Can't Open Address Bar With Window.open

Jul 23, 2005

With ref. to MS IE, when I use window.open with the usual sizing and
'toolbar=yes', 'menubar=yes' the target URL opens in a new window -
but without an address bar.

'addressbar=yes' does not seem valid. Can someone please tell me how
to proceed?

View 3 Replies View Related

Window.open - Cannot Open With Scrollbars

Oct 13, 2005

When creating a new window and specifying ANY features (on or off) at all like such:

<A HREF="javascript:void(0)"
onclick="window.open('NONE.php','welcome','toolbar=1,location=1,directories=1,status=1,menubar=1,resizable=1, scollbars=1')">
Open a new window</A> the new window does not have scrollbars even though scrollbars are necessary for my document (vertically, at least).

This problem occurs in Firefox and Internet Explorer 6. The problem does NOT occur if there are no features are specified.

View 3 Replies View Related

Need To Customize The Size Of The Window.open Window For Different Links

Jul 23, 2005

I've got this row of images (in the end there will be more rows of pics
as well). When a user clicks on the image, I want a new window to open
with a larger version of the image. I want that new window to be
customized to the size of the new larger image. Also, when users go
back to see other images in their larger size, I want the new window
(assuming they never closed the first one) to come back to the front.

I've only gotten as far as getting the larger images to open in a new
window at a set size in the function. I thought I could just make
specific scripts for each image, but that would be cumbersome to say
the least....

View 1 Replies View Related







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