|
-
Feb 2nd, 2007, 11:02 PM
#1
Thread Starter
Junior Member
[RESOLVED] # page load
PHP Code:
echo ' <a href="#" onclick="window.open(\[url]http://wahteversite.com/wahtever.php,\start\,\left=200,top=150,height=510,width=595,status\);[/url] return false;"><img src="/image.jpg" border="0"></a>
</ul>';
Any Ideas why i get
http://wahteversite.com/wahtever.php#
instead of http://wahteversite.com/wahtever.php
Thanks in advance
Excluding the [url] bbc tags
-
Feb 3rd, 2007, 01:08 AM
#2
Re: # page load
because you put a hash sign in the href attribute. why else?
-
Feb 3rd, 2007, 02:04 AM
#3
Re: # page load
Eww. Just eww.
echo()ing HTML code; using an event handler attribute; using window.open... I can't see anything good in that code, to be honest, and it's only one line. I shudder to think what the rest of it looks like.
-
Feb 3rd, 2007, 02:43 PM
#4
Thread Starter
Junior Member
Re: # page load
 Originally Posted by kows
because you put a hash sign in the href attribute. why else?
HUH? Ok now
LOL atleast your honest Penagate
Is this better?
PHP Code:
echo "<a href=\"#\" onclick=\"javascript: window.open('http:mysite.com','start','left=200,top=150,height=510,width=595,status'); return false;\"><img src=\"/virus.jpg\" border=\"0\"></a></ul>";
-
Feb 3rd, 2007, 03:01 PM
#5
Re: # page load
If anything, it looks worse.
Here is a post by visualAd that explains the basics of code formatting in PHP. Outputting HTML using echo() is inefficient, less readable, and error-prone, as you need to escape various characters.
Don't open pop-up windows: it's grossly 90s, and will be blocked by just about all modern browsers, leading to a messy, interrupted user experience. In general, don't tamper with browsing models in any way; just use plain links to navigate between pages. If you want to show a pop-up on the page, use Javascript; but be sure to provide a vanilla HTML solution for those without Javascript enabled/supported.
Edit: Here's a post by yours truly with some more points about why outputting using echo() is bad.
Last edited by penagate; Feb 3rd, 2007 at 03:06 PM.
-
Feb 3rd, 2007, 03:32 PM
#6
Thread Starter
Junior Member
Re: # page load
Thanks for the reads. I see what your saying.
-
Feb 3rd, 2007, 04:59 PM
#7
Re: # page load
you asked why you were getting your URL with a hash at the end of it. "#" is the hash character. you made the href attribute a hash, thus why you're getting the hash character at the end of your URL.
-
Feb 3rd, 2007, 05:18 PM
#8
Thread Starter
Junior Member
Re: # page load
 Originally Posted by kows
you asked why you were getting your URL with a hash at the end of it. "#" is the hash character. you made the href attribute a hash, thus why you're getting the hash character at the end of your URL.
Nevermind
-
Feb 3rd, 2007, 09:33 PM
#9
Re: # page load
 Originally Posted by Jazza
Nevermind 
you are acting like you have absolutly no idea what he is talking about!!
listen.
When you put a '#' in the 'href', then it reloads your page with the '#' at the end.
HTML Code:
<a href='#'>Link</a>
if you dont want that to happen, then put the javascript in place of the #
My usual boring signature: Something
-
Feb 4th, 2007, 01:57 AM
#10
Thread Starter
Junior Member
Re: # page load
Like i did in post #4
-
Feb 4th, 2007, 04:58 PM
#11
Re: # page load
 Originally Posted by Jazza
Like i did in post #4 
no..
My usual boring signature: Something
-
Feb 4th, 2007, 09:38 PM
#12
Thread Starter
Junior Member
Re: # page load
I'm lost then. Its working just fine like this.
Code:
echo "<a href=\"#\" onclick=\"javascript: window.open('http:mysite.com','start','left=200,top=150,height=510,width=595,status'); return false;\"><img src=\"/virus.jpg\" border=\"0\"></a></ul>";
Keep in mind I'm new to all of this as seen above
http://www.vbforums.com/showthread.php?t=449182
See i also created the newb thread.
-
Feb 4th, 2007, 10:05 PM
#13
Re: # page load
 Originally Posted by Jazza
I'm lost then. Its working just fine like this.
Code:
echo "<a href=\"#\" onclick=\"javascript: window.open('http:mysite.com','start','left=200,top=150,height=510,width=595,status'); return false;\"><img src=\"/virus.jpg\" border=\"0\"></a></ul>";
Keep in mind I'm new to all of this as seen above
http://www.vbforums.com/showthread.php?t=449182
See i also created the newb thread.
i can see that you new, you cant even spell n00b!
My usual boring signature: Something
-
Feb 4th, 2007, 10:09 PM
#14
Thread Starter
Junior Member
Re: # page load
See my entire point!!!
n00b!
-
Feb 4th, 2007, 10:56 PM
#15
Re: # page load
There's no need for that, either of you.
Jazza: Get rid of all the Javascript. Triggering script from links isn't a great idea at the best of times. Buttons (<button>) are more logical.
Assign event handlers from your script, which should be in an external .js file. Don't put them inline in the HTML, it's messy.
Also, href="#" is meaningless. href should always point to a page. If you must trigger script from a link, override the link action from your event handler by using e.preventDefault() (and whatever the IE equivalent is, I forget).
dclamp: Stop stirring.
-
Feb 4th, 2007, 11:07 PM
#16
Thread Starter
Junior Member
Re: # page load
Thanks for the info Penagate.
I learn something new everytime I come to this board.
-
Feb 5th, 2007, 12:52 AM
#17
Re: # page load
 Originally Posted by Jazza
Thanks for the info Penagate.
I learn something new everytime I come to this board.
dont forget! give rep to all who helped, and even thoes who didnt that much 
EDIT:
also, mark thread as "Resolved"
My usual boring signature: Something
-
Feb 5th, 2007, 01:37 AM
#18
Thread Starter
Junior Member
Re: # page load
Sure thing boss.
I'll make the thread read "resolved"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|