JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old February 25th, 2003, 08:41 AM
wap wap is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 20 wap User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
onclick problem

Hi i have the following code that dreamweaver mx creates when i want to open a link in a fixed sized new window

this is in the head

<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>

this is the link which is part php that opens new window

PHP Code:
<?php if  ( $row_Recordset1['Front'] =='Y'){?>
  <a title="<?php echo $row_Recordset1['Artist']; echo "-"; echo $row_Recordset1['Album']; ?>
  href="onClick="MM_openBrWindow('http://www.site.com/showme.html?','','width=500,height=585')"javascript:;>Front</a> 
<?php }?>


Everything works fine, only problem i have is that when the link gets hovered over, the curser doesn't change to a hand or arrow but the text input curser (I) instead and it looks naff.

This happens both in explorer 5.5 and latest netscape browsers. Could someone please tell me why this is and how to correct it. Thanks

Last edited by wap : February 25th, 2003 at 08:46 AM.

Reply With Quote
  #2  
Old February 25th, 2003, 09:26 AM
wap wap is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 20 wap User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
sorry - ignore me. just got " messed up. sorted it now. thanks anyway

Reply With Quote
  #3  
Old March 8th, 2003, 08:24 AM
wap wap is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 20 wap User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Well I thought I had it sorted. Posted my code below.


<a href="java script:void(0);" title="<?php echo $row_Recordset1['Artist']; echo "-";

echo $row_Recordset1['Album']; ?>" onClick="MM_openBrWindow('http://www.mysite.com/showcover2.html?<?php echo $row_Recordset1['Artist']; ?>-<?php echo $row_Recordset1['Album']; ?>-back','','width=500,height=585')">Back</a>

The above works great unless there is a ' in the link

for example

Blink182 works fine

Blink'182 link will not work

Is there anyway round this problem so that title links with a ' in will work.

Thanks for your time

Reply With Quote
  #4  
Old March 8th, 2003, 11:50 AM
numbernine numbernine is offline
Up To His Eyes In Ads
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Chicago
Posts: 160 numbernine User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 25 sec
Reputation Power: 16
You can solve the cursor problem with cascading style sheets. I don't remember the exact syntax...maybe somebody else does? Something like
Code:
{cursor: hand} 

Reply With Quote
  #5  
Old March 27th, 2003, 10:23 PM
dgibson dgibson is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2002
Location: Urbana, MD, USA
Posts: 66 dgibson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 17
First, Macromedia's built-in scripts generall y suck. Second, don't do that javascript:" crap in the HREF. Put the valid link in it so that if Javascript or popups are disabled, the user can still see the content in the main window. IF you want it to open a new window (full size) then add a target="_blank" to the anchor tag.

Last, if the PHP-generated variable could have invalid characters or spaces in it, there should be a URLEncodedFormat function of some sort (that term is CF - I don't know PHP). Such a funciton should escape all characters contained in the string to URL-safe characters. IF that doesn't do it, you can always escape a single quote in JS with a backslash- e.g. \'

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > onclick problem


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap