Having Trouble finding and replacing a value of a URL
I have multiple links on a page and i would like to change part of the url from file:// to
http://
Having trouble doing so.
Here is an example of the value of the link
- <h3 class="ms-srch-ellipsis"> <a clicktype="Result" id="ctl00_ctl52_g_b4789284_23fc_414a_bc11_762caff8cbe3_csr5_item_itemTitleLink" href="file://dev-server.gb.com/docs/project1.ppt" class="ms-srch-item-link" title="R&D Planning Cycle" onfocus="EnsureScriptParams('SearchUI.js', 'HP.Show', 'ctl00_ctl52_g_b4789284_23fc_414a_bc11_762caff8cbe3_csr5_item', 'ctl00_ctl52_g_b4789284_23fc_414a_bc11_762caff8cbe3_csr5_hover', '~sitecollection\u002f_catalogs\u002fmasterpage\u002fDisplay Templates\u002fSearch\u002fItem_PowerPoint_HoverPanel.js', false);" openapp="powerpoint">Project One Powerpoint</a> </h3>
I tried this and i am getting no errors but it isn't changing the value, help please :-)
- $('a').each(function() {
- $("ms-srch-item-link").attr("href", function(index, old) {
- return old.replace("file://", "http://");
- });
- });