onClick event

I have a table with an onClick event which is a link…

location.href=‘http://www.website.com/info/content.php

That is exactly as it is written in the ‘value’ box of the extended info dialogue.

I can’t for the life of me work out how to properly apend a ‘target=_blank’ to that location.href. I’ve tried, but I just don’t seem to be able to write it correctly for this input, and the link just goes dead.

any ideas?

Hugh


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I don’t think you can set the target attribute in a location.href
style pseudo-link. I have another suggestion for you. Make the link
inside the td expand to fill all available space. That way you don’t
have to use javascript for navigation – which is slightly evil,
since it makes core browser behavior only possible with JavaScript
enabled. If you click anywhere inside the link – which is now the
size of the TD – then you get normal browser navigation to that link.

Can you post a link to your page?

Walter

On Mar 3, 2008, at 10:51 AM, hugh wrote:

I have a table with an onClick event which is a link…

location.href=‘http://www.website.com/info/content.php

That is exactly as it is written in the ‘value’ box of the
extended info dialogue.

I can’t for the life of me work out how to properly apend a
‘target=_blank’ to that location.href. I’ve tried, but I just don’t
seem to be able to write it correctly for this input, and the link
just goes dead.

any ideas?

Hugh


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

How would you do that?..

Bear in mind that there are other javascript events associated with this cell, i.e. onMouseover and onMouseout.

http://www.conformance.info/cn - the obvious coloured table rows.

Hugh


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Easy peasy. You have the perfect layout to make this trick work
effectively. And you won’t need to change much. Your rollover effects
can be done entirely in CSS if you do this, since IE will respect
a :hover selector on an A, and not on anything else even though it’s
valid according to the W3C.

Make sure that your TD is set to have no padding. Ditto for the P
inside it. Then add padding to your A tag to make it have a shape,
and set the A tag to display:block.

So right now you have td class=“box”. Edit the box style to have
padding: 0. Then make some additional styles:

td.box p { margin: 0; padding: 0 }
td.box p a {
	display: block;
	padding: 6px 4px 6px 20px;
	background: #d9f1ff url(Resources/bullet_image.gif) no-repeat left  

center;
margin: 0
}
td.box p a:hover { background-color: $cf0 }

Make sure that your link text has no styling applied to it at all. It
won’t look nice in Freeway, but it will work in a browser.

Now in looking at your code, I see something alarming. There is a
complete page-within-a-page going on here. There is one complete page
wrapping around another complete page, with HEAD, BODY, etc.

Are you using some sort of template system here? Because your
inserted fragment needs to be cut down to be only the CONTENTS of the
BODY tag, not the entire head and body tags along with the content.
Your page is not valid, and won’t display correctly in browsers that
care about that sort of thing.

Walter

On Mar 3, 2008, at 11:58 AM, hugh wrote:

[quote] Make the link inside the td expand to fill all available
space.[/quote]

How would you do that?..

Bear in mind that there are other javascript events associated with
this cell, i.e. onMouseover and onMouseout.

http://www.conformance.info/cn - the obvious coloured table rows.

Hugh


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Walter, thanks for that.

I know CSS is the way to go, but I’m afraid every time I do it I spend hours in Freeway padding this and padding that, experimenting, republishing, adding another selector, changing something else…it’s all too trial-and-error for me, takes frigging ages! That’s why i plump for the rather nice (I think) and certain Javascript route.

But I’ll have a go, I just find css in freeway tables so unpredictable. Probably my skill level…:wink:

Yes, aware of the full html thing. it’s a PHP include bringing the masthead in - this masthead usually includes a navigation bar, hence separated so that it only has to be changed in one place.

Hugh


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Then in that masthead page only, apply the PHP Make Insert Page
action. It will chop off the head and body tags, leaving only the
content of the body, and optionally, any script tags. Get it at the
KB, or a hacked version (optionally spares the head content) at my
repository: http://freewaypro.com/actions/downloads/

Walter

On Mar 3, 2008, at 12:45 PM, hugh wrote:

Hi Walter, thanks for that.

I know CSS is the way to go, but I’m afraid every time I do it I
spend hours in Freeway padding this and padding that,
experimenting, republishing, adding another selector, changing
something else…it’s all too trial-and-error for me, takes
frigging ages! That’s why i plump for the rather nice (I think) and
certain Javascript route.

But I’ll have a go, I just find css in freeway tables so
unpredictable. Probably my skill level…:wink:

Yes, aware of the full html thing. it’s a PHP include bringing the
masthead in - this masthead usually includes a navigation bar,
hence separated so that it only has to be changed in one place.

Hugh


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options