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:
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old February 25th, 2003, 08:41 AM
wap wap is offline
Junior Member
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
Junior Member
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
Junior Member
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: 6
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: 6
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


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

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five &quot;checkpoints&quot; for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway