• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

javascript pseudo-protocol attribute value

 
Michael Petrovich
Greenhorn
Posts: 16
Eclipse IDE Opera Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64623
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Michael Petrovich
Greenhorn
Posts: 16
Eclipse IDE Opera Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 16
Eclipse IDE Opera Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well the question is where is that handler, what this mechanism is for and how does it call?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64623
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 16
Eclipse IDE Opera Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is CCSSE?
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well the question is where is that handler


What does handler mean?


Eric

 
Michael Petrovich
Greenhorn
Posts: 16
Eclipse IDE Opera Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64623
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, was a tad dyslexic, it should have been: SSCCE
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic