0

How to encode the url in this case: http://jsfiddle.net/spem/c89r1vu1/4/

<script type='text/javascript'>
$('#pnumbers li strong').each(function () {
    var html = $(this).html();
    $(this).html('<a href="http://example.com/search_query=' + html + '">' + html + '</a>');
});
</script>
<div id="pnumbers" class="rte">
    <ul>
        <li><strong>Isto é um teste</strong>

        </li>
        <li><strong>HP Q1292-67026</strong>

        </li>
    </ul>
</div>

1 Answer 1

1

From what I understand, you're asking about the encodeURIComponent() function.

Sign up to request clarification or add additional context in comments.

2 Comments

Yes just do not know how to apply. I do not understand programming. Can exemplify how?
so when you add html into your string, just wrap it in encodeURIComponent(). So it will look like this: encodeURIComponent(html).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.