/    Sign up×
Community /Pin to ProfileBookmark

Linebreak between Arguments

Hello Gurus,

I was wondering if it was possible to invoke a built-in method such as window.open() and break up the arguments across multiple lines.

For example:

<a href=”#” onclick=”window.open(‘url.htm’,’window’,’i want to break
this string of features up into multiple lines and still have it work’;return false)>

I realize that I could create a new function that simplifies the way the arguments are passed to this built in method, however I’m trying to get it to work without doing that. I have a server side programming language that has to create the code, and unfortunately the server side language is limited to 132 characters per line before I am forced to insert a linebreak. Does anyone have any idea?

Much Abliged,

Lorn K

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@VladdyJun 22.2004 — What kind of server-side language is that???

The only thing I can think of

'part of the string'+

'another part of the string'
Copy linkTweet thisAlerts:
@lkilianauthorJun 22.2004 — The server side language is a proprietary language that is probably unknown unless you work for a credit union. It is part of an AIX based PL1 programmed language for our data processing system.

The server side language is not important here. I realize that you can break up strings as you pointed out using the string concatenation operator:

'string fragment1'+

'string fragment2'

However, I am unable to break up strings that are part of the arguments for a built in method such as window.open()

window.open() has four possible string arguments which are [I]url, name, features and replace[/I]. If I break up any of these strings using string concatenation, the javascript engine in the web browser cannot interpret the code properly.

Has anyone else broken these strings up?
Copy linkTweet thisAlerts:
@lkilianauthorJun 22.2004 — Nevermind,

I got it to work finally using:

<a href="#" onclick="window.open('https://cspqa.epscu.com/paylinkcsphelp/faqs/faqs.htm','window','menubar=no,'+

'height=600,width=800,top=0,left=0');return false">FAQs</a>

I messed up the name arguement that was throwing it all off.
×

Success!

Help @lkilian spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...