Frames Revisted - Friendly Rediect

Jul 23, 2005

many framed sites have an ancient script in all their pages:
if(top==self) top.location=theframeset

Some friendlier ones do this:
if(top==self) document.write( '<a href=frameset>This page is '
+ 'supposed to be frames</a>.' )

These scripts fail when the page is loaded within somebody's else's
frameset.

Then top is not self but not a very cooperative top either. And with ever
growing security issues browsers have become quite paranoid. Even testing
for top's origin results in an error:

alert(top)
// gives me [object]
var s='' for (var i in top) s+=i+' '+top[i]+'
' alert(s);
var obj; try{ obj=top.location; } catch(e) { obj='' }
// give me [access denied] (of course)

I 'd rather drop the frames altogether, but the site has been like this for
years and the client insists. There are frames. So how would I detect when
it is appropriate to write:

<a href=>View this page in its <b>own</b> frames.</a> ?

Question b:
in the frameset, a little script looks into self.location.search for an url
with which to fill the main frame. Is there a way to avoid document.write
and onload?

View 5 Replies


ADVERTISEMENT

Need JS To Rediect To ASP Page When Browser Is Closed

Feb 28, 2006

I need sometype of function to redirect the browser window to an ASP page that clears a few session variables and deletes some temp entires into a database. I tried this in the head:

<SCRIPT Language="JavaScript" TYPE="text/javascript">
window.onbeforeunload = function() {
document.getElementById("sessiondestroy").src = "closeSession.asp";
}
</script>


Thought maybe I could make an image "swap" with the closesession.asp page, but it doesnt work.

View 2 Replies View Related

Printer Friendly Page

Aug 4, 2006

I have a print button in PHP page which using javascript
window.print() to print web page.

However , when user click "print" , the print preview display that the
page cut-off and alignment is out.

Read on regarding the matter , and found that is not the issue of PHP .
Some users recommend to me to use CSS and HTML to create printer
friendly page.
However my page is extension is in php , can i use CSS and HTML to
create printer friendly page?

View 2 Replies View Related

Rotating Feature Box SEO Friendly?

May 6, 2010

trying to find a good rotating box with SEO content.[URL]

View 5 Replies View Related

SE-friendly Link With Actual Destination Different?

May 11, 2010

I need to have certain links on my site appear to go one place for search engines:

<a href="http://example.com" ...

but go through an intermediate script to track clicks:

... onclick="window.location='http://example.org/track.php?id=112';">

I suppose that's easy enough, but, if the user doesn't have Javascript enabled, I'd like the click to still go through the tracking script.

View 2 Replies View Related

Friendly Password Field Code

Nov 7, 2001

Is anybody else having problems getting that code snippet to work?

<input type="text" value="Username" name="username"
onFocus="this.value=''" />
<input type="password" name="password"
style="background-image:url('password.gif');"
onFocus="this.style.background=#ffffff;" />

When the user clicks on the password form field, the background image is suppossed to be replaced with a white background color. All I get is a javascript error, and I copied straight out of the newsletter.

View 1 Replies View Related

Rewrite Ugly Url To User-Friendly Url

May 14, 2010

I have an html based website that needs urls converted from [URL] to [URL] the website has no mysql database. the urls are written through javascript. download from below the js + html files Code: [URL] urls writing rules can be found on common.js and set_form_menu.js.gz files

View 1 Replies View Related

Javascript + CSS Switcher For Printer Friendly Webpage

Sep 11, 2007

I am developing a site for a client that requires the printer friendly verison of the site to appear in a separate pop-up window. I am having trouble figuring out the scripting needed to have the current page open in a separate window with a different style sheet applied to it.

View 4 Replies View Related

Firefox Friendly Code To Dynamically Add Items To Combo Box?

Oct 13, 2010

Here is my code that works flawlessly in IE but I can't get it to work in firefox. what firefox doesn't like about this code?

<SCRIPT language="JavaScript" type="text/javascript">
//POPULATE COMBO BOX PER RADIO BUTTON CHECKED
function UpdateCombo()
{

[code]...

Now, I obviously left unrelated code out here; but that code is the basic of what Im working with, but the combo box is just empty in firefox. Works fine in IE; so I'm guessing it doesn't like something with the code:

document.getElementById("technical_issue_summary").add(new Option("***Phone Issues***"," "));

View 5 Replies View Related

JQuery :: Tabs Not Working When There's A Url-friendly Query String

Mar 11, 2010

I've added the most basic implementation of JQuery tabs. It's working fine so long as there's not a url-friendly query string.In other words, if I load index.php, it will work fine. Even index.php/anystring doesn't have any problems. However, if I try to load something such index.php/anystring1/anystring2, none of the CSS styles for the tabs appear to be applied to the tabs list making all the tabs' contents appear on the same page.how I can work around this to ensure I can preserve the current format of query string without breaking the tabs? Using the old fashioned way doesn't appear to result in any problems, but I'm trying to avoid having to revert to that format.

View 2 Replies View Related

User Friendly Anti Spam Email Script

Dec 22, 2003

We don't like putting our email addresses on our pages because we know we'll be spammed big time!

Of course you could use javascript and 'document.write' it out, but who wants script tags in his body? I don't!

So today I made the below and I thought I'd share. It kinda explains itself better then I ever could so. Code:

View 6 Replies View Related

Default Fill Friendly Form Character Countdown Script -- How To?

Jul 20, 2005

Is there a javascript or alternative default fill friendly way for counting down the remaining characters left in a form box?

View 2 Replies View Related

Frames Within Frames

Jul 23, 2005

As a rule, I don't like frames but I'm stuck supporting a web that uses
them. I have a page, default.asp, that has a header and body frame: "fHead"
and "fBody". What I want to do is to prevent default.asp from ever loading
itself into "fBody". Some users still have code that causes this behavior.

So how, using javascript , can I do something to the effect of: "If
default.asp tries to load default.asp (itself) into fBody, then reload the
top-level browser window with what fBody is trying to load."

Make sense? Any thoughts?

View 1 Replies View Related

Frames & Ssi

Feb 5, 2001

my main page consists of frames.
i'm using ssi to include copyright info, tos, and a privacy statement at the bottom of each page.

the ssi is working on all regular (ie non-frame) pages, but it doesn't seem to be called or parsed on the main page.

a look at the source shows the ssi call just sitting there, doing nothing.
has anyone dealt with this before?
i didn't think it mattered if an ssi was called from within a framed page, but i might be wrong.

i suppose i can just use the actual html for that one page but i'd rather just be able to use ssi since it's used through out the rest of the site.

View 4 Replies View Related

Printing Other Frames

Jul 23, 2005

I have a frameset with two frames, and want to have a button in one
frame call print() in the other one:

This is the layout:

<frameset rows="*,40" frameborder="NO" border="0" framespacing="0">
<frame src="..." name="pritableText">
<frame src="..." name="printButton" scrolling="NO" noresize>
</frameset>

And, in printButton, I got this code:

<a href="#" onClick="parent.printableText.focus();
parent.printableText.print();">Print the page</a>

However, nothing happens in Netscape (7.01) and Firefox (0.8), and in IE (6)
I get an "error in the script". However, I do not identify the error.

Does anyone have a clue onto what's happening?

View 1 Replies View Related

Refreshing Frames

Jul 23, 2005

Let me just start by saying... and I truly do mean this... I HATE frames. Now that I have that out of my system, unfortnualty I do not have a choice and am forced to use the complex structure that I am so SO needing help with. My framesets look like this

---------------------
| title |
|--------------------
| buttons |
|--------------------
| base |
|--------------------

inside the base frame I have ANOTHER frameset... split into frmLeft and frmRight... now if your mind isnt tied into knots... I am sure this will do it... I have a button called 'add category', which is on the buttons frame. When I click the button, I get a popup with the details... I add the category details... then I need the frame titled frmLeft to refresh. Is this possible?

View 1 Replies View Related

Cookies And Frames

Jul 23, 2005

What's the trick to sharing cookies between frames? I can set and read a
cookie in the same frame, but if I try to read the cookie in another frame
it is undefined. :o(

There are some other cookies that are available in all frames, so I know
that the frames are capable of reading cookies, just not the ones that I set
in the other frame.

View 1 Replies View Related

Using Frames / Iframes

Sep 12, 2005

I believe that different browsers treat frames/iframes differently, and this
is one of the reasons to avoid using them in websites/applications.

Are there any other reasons to avoid them?

In my experience I find them clunky and messy to implement using javascript
and prefer to keep the whole web page as a single page.

View 1 Replies View Related

Need Help With Forms Within Different Frames.

Sep 14, 2005

I have to iframes within one page. When I triger action in one frame, I
need to update the content's of other frame's selection list.

How to access second frame's form element from my first frame in index
page?

Suppose I named my second frame "content", and form element is named
simply "form1". If I try to access that form by refering:

parent.content.document.form1, I get nothing at all.

View 3 Replies View Related

Inline Frames

Sep 22, 2005

I apologize if this is not the right group for this, but I saw some
other messages on this topic in here, so thought I'd take a shot in the
dark...

I am running IE 6, XP, SP2. When I connect to certain sites that use
inline frames, I get the message 'Your browser does not support inline
frames or is currently configured not to display inline frames.'

The aggravating thing is I recently bought multiple Dell computers,
have 2 in the room with me right now, haven't touched a thing
browser-wise on either, and it works fine on 1 and not the other. Same
OS, same IE version, etc.

View 2 Replies View Related

Refresh Frames

Nov 23, 2005

How can I refresh a page in a separate frame. For example, when someone logs in in the main frmae, I want to refresh another frame to display info differently.

View 4 Replies View Related

Using Frames And Getting InnerHTML

Mar 8, 2006

I am using a frameset with two frames that looks like this:

|------------------------------|
| |--------------------------| |
| | FRAME 1 | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| |--------------------------| |
| |
| |--------------------------| |
| | FRAME 2 | |
| | | |
| | <html><body> | |
| | <table><tbody> | |
| | <tr> | |
| | <td>Data 1</td> | |
| | <td>Data 2</td> | |
| | </tr> | |
| | </tbody></table> | |
| | </body></html> | |
| |--------------------------| |
|------------------------------|

FRAME 2 has no height, so it looks as if you only have 1 frame. I am
using FRAME 2 to retrieve data from my server.

I open up FRAME 1 with my webpage and leave FRAME 2 empty. When the
user request data I target FRAME 2 and the data is loaded into FRAME 2.

What I have been trying to do is this. Take the innerHTML of the FRAME
2's table and load it into a table in FRAME 1.

View 1 Replies View Related

Monthly Frames

Sep 19, 2006

I am using frames - yes frames - I do not know how to do anything but and I
know that there is better out there......but........
I am trying to set a frame so that it automatically puts a page
corresponding to the month in that frame (a calendar) Code:

View 6 Replies View Related

Print Using Frames

Jan 26, 2007

how do I create a print button that is on my index page that prints my
target page (and only the target page)

I tried
<INPUT onclick=window.print(); type=button value="Print This Page"
style="font-size: 10px; float:right">

But it prints the index page.

View 2 Replies View Related

Printing Frames

Jul 20, 2005

I have a script for printing the contents of a frame.
It works fine but I would like it not only to print the designated frame
but to add a header or message at the top or bottom.

View 1 Replies View Related

Frames And Forms

Jul 20, 2005

i'm trying to use javascript to change the content of a textbox in a
different frame.

by clicking on a 'folder' link in 'leftFrame' i want to put the value
assigned by that link into the 'folderName' textbox in the
'uploadForm' form in 'mainFrame'. i'm doing this as...

onClick="parent.mainFrame.uploadForm.folderName.value='fold er'"

this works perfectly fine with IE and Safari on my Mac OS X machine
and IE 6 on my PC laptop but anything Mozilla-based on either machine
gives me an error i just can't seem to get round...

'parent.mainFrame.uploadForm has no properties'

View 1 Replies View Related







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