Tiny URL for HTML Usage
Posted by Jean-Philippe Tremblay - Dec 9 ’16 at 08:41
Hi,
First Question :
My Sharepoint store a long URL into a column and i need to use it in HTML for embedded content and picture callaing.
I was planning to use the following code. As soon as i use it, i got display error such loosing tabs. Any idea how i can achieve that?
use import javaQuery.j2ee.tinyURL;
public static void main(String[] args) {
tinyURL tU = new tinyURL();String getLink tU.getTinyURL(fd.field('LongURL_InternalName').value() );
fd.field('LongURL_InternalName').value() = getLink}
//Assign @LongURL_InternalName in HTML Content for URL
Second question:
Is possible to get the current URL of the form and store it in a field ?
Thanks again for your Help
-
Dmitry KozlovAdminMember for: 7 years 5 months 5 days
Hi,
1. You can try the following jQuery plug-in to shorten a URL from JavaScript:
http://hayageek.com/jquery-url-shortener/
2. Use the code below to get current URL from the browser and put into a field:
var currentURL = window.location.href; // getting URL fd.field('FieldName').value(currentUrl); // putting into a field
-
Jean-Philippe TremblayMemberMember for: 4 years 2 months 22 days
Hi,
I need to get the Display URL and store it.
In javascipt, i used :
var currentURL = window.location.href; // getting URL
fd.field('FormURL').value(currentURL);
alert(fd.field('FormURL').value())
var QRCodeLinkGoogleLink = "https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl="
var QRcodeConcatenate = QRCodeLinkGoogleLink.concat(currentURL)
fd.field('QRcodeURL').value(currentURL);
but i retrieve a blank field for FormURL. I Guess it beause the field is read-only? I have a HTML Block who use it to generate QR Code<img src="{@QRcodeURL}" alt="QR Code" style="width:304px;height:228px;">
Is it possible to get the display URL during the New Form so i can store it? Or any Idea?
-
Dmitry KozlovAdminMember for: 7 years 5 months 5 days
[#2]: Hi,
You cannot get URL of a display form until you save the item bacause its ID is populated after saving only.