Sorry, but i'am not familiar with Javascript in uniGui
but how to Replace the "This is some text"
I have used the code, but should i add this code to every element on my forms?
Could you send a sample?
I used the code as follow:
For those controls and text that i want user to copy,
>> OnClick on uniEdit
CopyEvent(edit1.text)
procedure TMainForm.CopyEvent(FText: string);
begin
UniSession.AddJS(
'var isIe = (navigator.userAgent.toLowerCase().indexOf("msie") != -1 ' +
' || navigator.userAgent.toLowerCase().indexOf("trident") != -1); ' +
' ' +
'document.addEventListener("copy", function(e) { ' +
' var textToPutOnClipboard = "' + FText + '"; ' +
' if (isIe) { ' +
' window.clipboardData.setData("Text", textToPutOnClipboard); ' +
' } else { ' +
' e.clipboardData.setData("text/plain", textToPutOnClipboard); ' +
' } ' +
' e.preventDefault(); ' +
'}); '
);
end;
In IE, this code is not working.