|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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:
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. |
|
#2
|
|||
|
|||
|
sorry - ignore me. just got " messed up. sorted it now. thanks anyway
|
|
#3
|
|||
|
|||
|
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 |
|
#4
|
|||
|
|||
|
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}
|
|
#5
|
|||
|
|||
|
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. \' |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > onclick problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|