Tiny URL for HTML Usage
- Jean-Philippe Tremblay
- Posts: 8
- Joined: Sun Dec 04, 2016
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
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 Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
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:
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:
Code: Select all
var currentURL = window.location.href; // getting URL
fd.field('FieldName').value(currentUrl); // putting into a field
- Jean-Philippe Tremblay
- Posts: 8
- Joined: Sun Dec 04, 2016
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= ... ht=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?
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= ... ht=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 Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Hi,
You cannot get URL of a display form until you save the item bacause its ID is populated after saving only.
You cannot get URL of a display form until you save the item bacause its ID is populated after saving only.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 3 guests