homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

Help please - how to extract link from link defined with javascript
Javascript code is giveg, get link from it

5+ Year Member

Msg#: 4614143 posted 2:07 am on Oct 2, 2013 (gmt 0)

Please help me. I have this JS code and from it I must to get link to enter it manually into browser:

Now when someone click on this link I don't see link into status bar because it is posted with javaScript which is defined in next part
<a id="oleVote1023" href="javascript: VoteFor(1023);" class="oleVote"></a>
<a id="oleVote1024" href="javascript: VoteFor(1024);" class="oleVote"></a>
<a id="oleVote1025" href="javascript: VoteFor(1025);" class="oleVote"></a>

I guess that number 1023, 1024, 1025, etc. is variable idGlas, do it is as I think?

<script type="text/javascript">
var idGlas;
function VoteFor(idGlas) {
type: "POST",
url: 'ajax/votepage.php',
data: { idGlasPost: idGlas },
success: function(retVal) {
if(retVal == 'block') {
alert('One IP one vote please.');
$('.oleVote').css('display', 'none');
$('#OleVote' + idGlas).css('display', 'none');
} else if(retVal == 'error') {
alert('Error, please try again to vote.');
} else {
//if vote is calculated than show total number of votes for voted person
$('#b_' + idGlas + ' .totalVotes').html(retVal);
$('.oleVote').css('display', 'none');
$('#OleVote' + idGlas).css('display', 'none');

Can you help me please and tell me how I to from this code extract link which I can to manually enter into address bar?

I try
http://www.DOMAIN.com/ajax/votepage.php?idGlasPost=1025but don't success.

Thank you very much



WebmasterWorld Senior Member 5+ Year Member

Msg#: 4614143 posted 4:05 am on Oct 2, 2013 (gmt 0)

type: "POST",
url: 'ajax/votepage.php',
data: { idGlasPost: idGlas },

The script makes a POST request, anything entered into address bar is a GET request.

idGlas is sent as POST data an not as part of URL.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved