473,398 Members | 2,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Need for 3rd kind of paranthesis

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
6 2609


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
"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
"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
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
"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Gregory Nans | last post by:
hello, i need some help to 'tree-ify' a string... for example i have strings such as : s = """A(here 's , B(A ) silly test) C(to show D(what kind) of stuff i need))""" and i need to...
2
by: Joh | last post by:
Hello, (sorry long) i think i have missed something in the code below, i would like to design some kind of detector with python, but i feel totally in a no way now and need some advices to...
7
by: Mike Kamermans | last post by:
I hope someone can help me, because what I'm going through at the moment trying to edit XML documents is enough to make me want to never edit XML again. I'm looking for an XML editor that has a...
5
by: imranzafar | last post by:
Hi! I am a beginner in C++. This is little assignment. It gives an error "Structure Require on Left Side of dot operator" Can anybody help me what went wrong in this code? #include <conio.h>...
7
by: Zest4Csharp | last post by:
Can someone please show me where to find documentation about the use of paranthesis in the context shown in the sample line of code below:? Button bt=(Button)sender; Your help is truly...
20
by: mike | last post by:
I help manage a large web site, one that has over 600 html pages... It's a reference site for ham radio folks and as an example, one page indexes over 1.8 gb of on-line PDF documents. The site...
2
by: Troels Thomsen | last post by:
Hello, I am wondering if I can write some code, that allows me to call functions in the console , IDLE, without using the paranthesis notation. Like print. This will improve "intreractive'ness"...
4
by: adityajain | last post by:
Well ! I have a confusion.When we length of an array we just use a.length; but to find length of an string we use S.length();.Why paranthesis are not used in case of array,however to call any method...
1
by: Luron31 | last post by:
Hello everyone, im doing a project and im really stuck on it... i dont want answers. i have a very guilty conscience. i just need some hints as to what im doing wrong or what i could do...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.