| Author |
javascript pseudo-protocol attribute value
|
Michael Petrovich
Greenhorn
Joined: Sep 06, 2011
Posts: 16
|
|
I'm not so strong in JavaScript. Google doesn't understands semicolons.
Tell me please what this attribute value mean:
"javascript:;" ?
Like here:
<a href="javascript:;" class="buttonRed1 triggerModal" name="manageModal"><span>MANAGE SOME</span>
So what is "javascript:;" here? (Note: semicolon is here)
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56229
|
|
|
The "javascript:" prefix is a pseudo-protocol that tell the browser to execute the supplied javascript when the link is clicked. In this example, that script is simply and empty statement followed by its terminating semi-colon.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Michael Petrovich
Greenhorn
Joined: Sep 06, 2011
Posts: 16
|
|
Sorry but I think that is not real.
I've seen html page with such code. And by clicking in corresponding reference some action is occurred.
Sorry but I can't post here all html page for security reasons.
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
Michael Petrovich wrote:Sorry but I think that is not real.
What do you mean by this. Bear's explaination is correct.
Michael Petrovich wrote:And by clicking in corresponding reference some action is occurred.
If some action occurred, there was probably an onclick event handler added to the element that fired some JavaScript code.
Eric
|
 |
Michael Petrovich
Greenhorn
Joined: Sep 06, 2011
Posts: 16
|
|
|
Well the question is where is that handler, what this mechanism is for and how does it call?
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56229
|
|
|
How can we possibly tell without seeing some code? If you can't show the real code, show us a CCSSE that demonstrates the issue.
|
 |
Michael Petrovich
Greenhorn
Joined: Sep 06, 2011
Posts: 16
|
|
|
What is CCSSE?
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
Well the question is where is that handler
What does handler mean?
Eric
|
 |
Michael Petrovich
Greenhorn
Joined: Sep 06, 2011
Posts: 16
|
|
I don't know what handler. That were your words:
Eric Pascarello wrote:
If some action occurred, there was probably an onclick event handler added to the element that fired some JavaScript code.
Eric
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
|
The onclick handler is added in the JavaScript code somewhere. Where and what it does is impossible for us to tell you since we do not have your source code.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56229
|
|
|
Sorry, was a tad dyslexic, it should have been: SSCCE
|
 |
 |
|
|
subject: javascript pseudo-protocol attribute value
|
|
|