Developer Account Developer Account - 5 months ago 28
Javascript Question

Creating Dynamic FTP Link in JqGrid Column

I'm creating a dynamic link on the last "column" of the jqGrid,and I'm putting an a tag inside this column,the value of "href" must be a link which is coming from my action and is an ftp address.
The problem is that despite the correct value of href,clicking the link navigates the user to the wrong url which is starting with "http"!!!
I wanna remove this extra "http"!!!

Here is the code to

'<a id="file" href="//' + rowobject.GeneratedFilePath + '" title="download"><div class="icon-details fa fa-external-link" style="display:inline-block"></div></a><span> </span>';


and here is the generated link
<a>
in runtime:

<a title="download" href="//ftp.test.com/Stat_On_150125_Daily.csv" id="file"><div style="display:inline-block" class="icon-details fa fa-external-link"></div></a>


and by clicking the link I'll be navigated to the following url:

http://ftp.test.com/Stat_On_150125_Daily.csv

Answer

The solution was really easy!! I've found it,I have to add ftp:// in the beginning of href value That's it.

<a title="download" href="ftp://ftp.test.com/Stat_On_150125_Daily.csv" id="file"><div style="display:inline-block" class="icon-details fa fa-external-link"></div></a>

Thanks a lot