Jump to content
php.lv forumi
  • 0

Ieteikt draugiem simbolu problēma


shurix

Question

<a href="javascript:(function(){window.open('http://www.draugiem.lv/say/ext/add.php?title=<?php echo $nosaukums; ?>&link='+window.location+(document.domain?'&titlePrefix='+document.domain.replace('www.',%20''):''),'','location=1,status=1,scrollbars=0,resizable=0,width=530,height=400');})();">Ieteikt draugiem.lv</a>

 

Itkā darbojas, bet ir viena problēma. Scripts nogrieži linku uz rakstu pie pirmās garumzīmes vai kāda cita simbola. ! piemeram. Kāda funkcija spētu dabūt visu pilno linku vai vismaz pārkonvertēt sliktos simbolus uz kaut ko kas darbotos?

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Paņēmu no dr.lv viņu pašu veidotu funkciju

function DraugiemSay( title, url, titlePrefix ){
window.open(
 'http://www.draugiem.lv/say/ext/add.php?title=' + encodeURIComponent( title ) +
 '&link=' + encodeURIComponent( url ) +
 ( titlePrefix ? '&titlePrefix=' + encodeURIComponent( titlePrefix ) : '' ),
 '',
 'location=1,status=1,scrollbars=0,resizable=0,width=530,height=400'
);
return false;
}

<a href="#" onclick="DraugiemSay('<?=$nosaukums?>', '<?=$links?>', 'mans webs');">Ieteikt</a>

 

Nosaukumā rāda gan garumzīmes gan izsaukuma zīmi, bet links apraujas pie pirmās garumzīmes vai izsaukuma zīmes vai cita simbola. Uztaisot echo $links viss radās pareizi, bet nesaprotu kapēc uz draugiem nosūtīt neizdodas.

Edited by shurix
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...