By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,381 Members | 1,641 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,381 IT Pros & Developers. It's quick & easy.

Need for 3rd kind of paranthesis

P: n/a
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.edita ce_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
Jul 20 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a


Pavel Vetesnik wrote:
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.edita ce_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?


You could write a function and simply call it in the onclick handler.
Or you can escape the quotes
window.location.href = 'whatever.php?\'string\'';

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2

P: n/a
"Pavel Vetesnik" <Pa*******@volny.cz> wrote:
I have code like this:
===============================================
<button title="Osobní nastavení (jméno a heslo)"
onClick="window.location.href='el_cas.Funkce.edit ace_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.editac e_uzivatele('el_cas.el_casopisy.zacatek?cDruhAplik ace=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.e l_casopisy.zacatek?cDruhAplikace=casopisy')'"

If the existing function can not be rewritten then write a new
function
onClick="newFunc('el_cas.el_casopisy.zacatek?cDruh Aplikace=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

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #3

P: n/a
"Pavel Vetesnik" <Pa*******@volny.cz> wrote in message
news:be***********@ns.felk.cvut.cz...
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.edita ce_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?
Jul 20 '05 #4

P: n/a
On Fri, 04 Jul 2003 15:32:03 +0000, Anonymous Joe wrote:
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:to*****@goddamn.co.uk | pgp:0x6A2A7D39
aim:inka80 | icq:6622880 | yahoo:tobyink | jabber:ta*@jabber.linux.it
http://www.goddamn.co.uk/tobyink/ | "You've got spam!"
playing://coldplay/parachutes/05_yellow.ogg
Jul 20 '05 #5

P: n/a
"Toby A Inkster" <Us******************@deadspam.com> wrote in message
news:pa****************************@goddamn.co.uk. ..
On Fri, 04 Jul 2003 15:32:03 +0000, Anonymous Joe wrote:
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:to*****@goddamn.co.uk |

pgp:0x6A2A7D39 aim:inka80 | icq:6622880 | yahoo:tobyink | jabber:ta*@jabber.linux.it
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


Jul 20 '05 #6

P: n/a
Make a function

"Pavel Vetesnik" <Pa*******@volny.cz> wrote in message
news:be***********@ns.felk.cvut.cz...
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.edita ce_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

Jul 20 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.