Need for 3rd kind of paranthesis

P

Pavel Vetesnik

Hello,

my question is probably quite stupid, but I really don't know how to solve
it.
I have code like this:
===============================================
<button title="Osobní nastavení (jméno a heslo)"
onClick="window.location.href='el_cas.Funkce.editace_uzivatele([el_cas.el_ca
sopisy.zacatek?cDruhAplikace=casopisy])'">My setup</button>
===============================================

The problem is, that I have double paranthesis (") surrounding the onClick
reference, inside of them are single paranthesis (') and now I need another
ones for passing parameter of the function.
In the example above it is surrounded by ([]) marks. That doesn't work on
HTML page, of course.

Please can you help me with this?

Thank you in advance!
Pavel
 
S

Steve Pugh

Pavel Vetesnik said:
I have code like this:
===============================================
<button title="Osobní nastavení (jméno a heslo)"
onClick="window.location.href='el_cas.Funkce.editace_uzivatele([el_cas.el_ca
sopisy.zacatek?cDruhAplikace=casopisy])'">My setup</button>
===============================================

And what happens when JavaScript is turned off?
The problem is, that I have double paranthesis (") surrounding the onClick
reference, inside of them are single paranthesis (') and now I need another
ones for passing parameter of the function.

Those are quotes not parentheses. Parentheses are ( and ).

Anyway, you don't need you single quote marks. You want the
el_cas.Funkce.editace_uzivatele() to be evaluated as a function not
treated as a string.

onClick="window.location.href=el_cas.Funkce.editace_uzivatele('el_cas.el_casopisy.zacatek?cDruhAplikace=casopis')"
In the example above it is surrounded by ([]) marks. That doesn't work on
HTML page, of course.

In general you should not include JS code directly in event handlers.
Simply call a function in the event handler and leave all the actual
JS code in the function itself (which should probably be in an
external .js file).

So, I'd rewrite the JavaScript function so that the
window.location.href is part of the function and then call the
function only from the event handler.

onClick="el_cas.Funkce.editace_uzivatele('el_cas.el_casopisy.zacatek?cDruhAplikace=casopisy')'"

If the existing function can not be rewritten then write a new
function
onClick="newFunc('el_cas.el_casopisy.zacatek?cDruhAplikace=casopisy')"

function newFunc(boo) {
window.location.href = el_cas.Funkce.editace_uzivatele(boo);
}

And above all make sure that the essential functionality still works
when JS is not available.

Steve
 
A

Anonymous Joe

Pavel Vetesnik said:
Hello,

my question is probably quite stupid, but I really don't know how to solve
it.
I have code like this:
===============================================
<button title="Osobní nastavení (jméno a heslo)"
onClick="window.location.href='el_cas.Funkce.editace_uzivatele([el_cas.el_ca
sopisy.zacatek?cDruhAplikace=casopisy])'">My setup</button>
===============================================

The problem is, that I have double paranthesis (") surrounding the onClick
reference, inside of them are single paranthesis (') and now I need another
ones for passing parameter of the function.
In the example above it is surrounded by ([]) marks. That doesn't work on
HTML page, of course.

Please can you help me with this?

Thank you in advance!
Pavel

There are three kinds of parentheses, the primary one is ( and ), the
secondary is [ and ], and the tetriary one is { and }.

But you are using quotes. There is just the two, the primary double
quote -- " and the secondary single quote, or the quote within a quote, '.

I find it odd that you would need a third quote, since nobody else in the
world has found a need for one.

Where you have marked what you would want to put in the tetriary quotes, the
non-existent ones, doesn't even need quotes as it is enclosed in
parentheses.

However, Javascript has a little problem where it is turned off in ~15% of
people's PCs and some browsers just outright don't allow Javascript, so
there could be 20% if not more of your viewers will be very frustated by
your persistent use of buttons that do things that a simple <a
href="2nd-page.html"> could do, or a <a href="2nd-page.html"><img
src="button-decoy.gif" border="0"></a>.

See?
 
A

Anonymous Joe

Toby A Inkster said:
There are three kinds of parentheses, the primary one is ( and ), the

No, there are only two: ( and ).
secondary is [ and ],

These are brackets.
and the tetriary one is { and }.

These are braces.

--
Toby A Inkster BSc (Hons) ARCS | mailto:[email protected] | pgp:0x6A2A7D39
aim:inka80 | icq:6622880 | yahoo:tobyink | jabber:[email protected]
http://www.goddamn.co.uk/tobyink/ | "You've got spam!"
playing://coldplay/parachutes/05_yellow.ogg

OK, I can't argue here, but if you think back to algebra class, in an
equation, you might have the brackets as a 2nd parentheses, but you would
use the braces to delimit domain/range.... sort of like:

y = [x(x-2)]
x={1,2,3}

fairly simple, tho
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,812
Messages
2,569,694
Members
45,478
Latest member
dontilydondon

Latest Threads

Top