/    Sign up×
Community /Pin to ProfileBookmark

opening new window from link

i’m try to design a form, and need to open a new window when the word view is clicked on. I have the code below which works fine in opening a new window with correct info, but it also changes the main window to a white page with ‘[object]’ written on it….i dont want the main window to change. Is there a way around this?

echo “<td><a href=”javascript:window.open(‘people_details.php?user_id=$user_id’,’details’,’width=300,height=200′);”>::View</a></td>n”;

thanks for the help!

to post a comment
JavaScript

8 Comments(s)

Copy linkTweet thisAlerts:
@steelersfan88Apr 04.2004 — &lt;a href="#" onclick="window.open
('people_details.php?user_id=$user_id','info','width=300,height=200');
return false;"&gt;::View&lt;/a&gt;
or something like that . Remember, the HREF = Hypertext REFerence, and should be a valid URL or similar
Copy linkTweet thisAlerts:
@redijediApr 04.2004 — Just off the top of my head: Try not to put it in the href. How about onclick? Also, java script should be javascript - one word.

<a href="#" onclick="javascript:window.open('people_details.php? user_id=$user_id','details','width=300,height=200'

);">::View</a>


Hope that helps.
Copy linkTweet thisAlerts:
@WarheadauthorApr 04.2004 — That's awesome guys__thanks a lot for your help!!
Copy linkTweet thisAlerts:
@steelersfan88Apr 04.2004 — sure, glad to help out (from all of us who did)
Copy linkTweet thisAlerts:
@redijediApr 04.2004 — No problem. Sorry, I didn't notice that steelersfan88 was already on top of that one. Good job!
Copy linkTweet thisAlerts:
@steelersfan88Apr 04.2004 — great minds think alike ?
Copy linkTweet thisAlerts:
@Paul_JrApr 04.2004 — [i]Originally posted by redijedi [/i]

[B]Just off the top of my head: Try not to put it in the href. How about onclick? Also, java script should be javascript - one word.[/B][/QUOTE]

The [FONT=courier new]javascript:[/FONT] pseudo-protocol isn't even needed there, and the forum adds the space. :-D
Copy linkTweet thisAlerts:
@steelersfan88Apr 04.2004 — adds the space ... in the [code] tags
×

Success!

Help @Warhead 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.25,
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,
)...