Jump to content

COMFIED

Members
  • Content Count

    87
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by COMFIED

  1. Thanks. It has worked. This is the code I have used: implementation var document external "document" : Variant; { TForm1 } procedure TForm1.W3Button1Click(Sender: TObject); var element := document.createElement('img'); var moretext1 := "<br>this is more text<hr>"; var addgraphics1 := "<img src= 'data:image/gif;base64,R0lGODlhEAAOALMAAOazToeHh0tLS/7LZv/0jvb29t/f3//Ub/ /ge8WSLf/rhf/3kdbW1mxsbP//mf///yH5BAAAAAAALAAAAAAQAA4AAARe8L1Ekyky67QZ1hLnjM5UUde0ECwLJoExKcpp V0aCcGCmTIHEIUEqjgaORCMxIC6e0CcguWw6aFjsVMkkIr7g77ZKPJjPZqIyd7sJAgVGoEGv2xsBxqNgYPj/gAwXEQA7'>"; begi
  2. Thanks. I my code below, the first part of the text displays, but the appended text does not show - what am I doing wrong? var element := document.createElement('img'); element.src:= "data:text/html;charset=utf-8,This is some text..."; var moretext := document.createTextNode("more text"); element.appendChild(moretext); document.body.appendChild(element); W3IFrameHtmlElement1.Src := element.src;
  3. Is it possible to display a variable source HTML text content in the W3IFrameHTMLElement component, instead of pointing src to to a URL? What I want to achieve is displaying dynamic web content in the W3IFrameHTMLElement , generated from code (not in /res folder or external URL). I have tested CSS-based examples on http://stackoverflow.com/questions/9689109/how-to-display-javascript-variables-in-a-html-page-without-document-writewith no success. Is there a way of wrapping document.getElementById or document.querySelector calls in SmartMobileStudio's W3IFrameHTMLElement?
  4. COMFIED

    DateToStr(Now)

    I have found a simple way to get the current date and time on the system, irrespective of time zone. USES ......, W3C.Date; procedure TForm1.GetCurrentDate; VAR Date: JDate = JDate.Create; GET_YEAR, GET_MONTH, GET_DAY, GET_HOUR, GET_MIN, GET_SEC: STRING; ​begin GET_YEAR:= FloatToStr(Date.getFullYear); GET_MONTH:= FloatToStr(1+ Date.getMonth); GET_DAY:= FloatToStr(Date.getDate); GET_HOUR:= FloatToStr(Date.getHours); GET_MIN:= FloatToStr(Date.getMinutes); GET_SEC:= FloatToStr(Date.getSeconds);​ //note that the month value will be between 0
  5. I am referring to sample code in: http://www.javascripture.com/FileReader See example readAsText Is there a way of coding this functionality in SmartMobileStudio so that I can read the file contents into a text variable?
  6. Hi I am trying to import content from a text ot CSV file located in the phone. Is there a way to locate the file and then read the text content into a memo or text variable? I have seen the JavaScript FileReader object in blogs but I don't know how to use it in SmartMobileStudio. Any ideas?
  7. Hi I am looking for sample code for signing in via Facebook, Twitter or Google account to authorize app use.
  8. In Project > Project Options I have turned on Code Packing and Code Obfuscation. But when I compile, URL strings in the obfuscated code are still searchable with a text editor. Is there a way to encrypt these too? Here are some of the string examples I am trying to encrypt and hide in the HTML and Javascript: FHttp1.open("POST", "http://localhost/test/local_account.php"); and ACC_WRITE:= 'http://localhost/test/acc_write_.php/?'; I am looking for strong code encryption like that provided on http://www.htmlprotection.kom.gt/
  9. On my local browser (Chrome and IE), the demo works for remote JSON file but does not work with the local file inet.txt - the Download('res/inet.txt'); does not fire status 200 and the file doesn't download/ doesn't display.
  10. Hi. Is there a way to read a .txt file from the /res folder into a string variable or memo field?
  11. The problem was the file preferences.xml (located in c:\ProgramData) got corrupted. I deleted it and restarted the Smart IDE and the file was recreated and the error disappeared.
  12. I am getting an error when starting Smart Mobile Studio Professional (see attached screenshots). I purchased license in December 2014, and upgraded from Windows 8.1 to Windows 10 three weeks ago and have been using it without any problem. Kindly assist.
  13. Thanks. How can read the URL with parameters automatically into the function when the smartmobilestudio app initializes?
  14. How can I read parameters passed to the smartmobilestudio index.html file and use the param values in my code? Example read the id value in index.html/?id=123
  15. Thanks Is there a way I can disable history of the browser component W3IFrameHTMLElement?
  16. Hi I am having problem exiting a browser-based Windows Phone app normally when it has browser history. How can the code above be modified to clear the web navigation history with each event on the page, so that the back-button log is always empty? I have tried using the BrowserAPI.Body handle but still unable to make it work.
  17. Hi, I am looking to a way to detect a long tap, say 2-3 seconds on an image or panel so as to enhance user functionality. There is some JS code for this on http://jsfiddle.net/f23ZW/ Any simple way I can do this using Object Pascal?
  18. COMFIED

    Label Text Wrap

    How can I modify the properties of W3label so that the caption text auto-wraps into multiple lines (like a memo) while aligned to top-left?
  19. Thanks Diaz - I'll use the LocalStorage. I am trying to save a html file then open and display it using the browser (W3IFrameHTMLElement). The usual way would be to assign the browser Src property = res/filename.htm Is there a way I can do the same with a file from localstorage? Once I read the content from LocalStorage into a string variable, how can I set the W3IFrameHTMLElement URL to display html content from the variable?
  20. How can I save a text file into the resources folder using code during runtime?
  21. When an input box is selected, is there a way to default the touch screen keyboard to numeric input for iOS, Windows Phone and Android?
  22. On the Windows Phone 8.1 (with Lumia Denim update), the phone's IE browser w3_getIsInternetExplorer returns FALSE, w3_getIsAndroid returns TRUE and also w3_getIsSafari also returns TRUE. But the Windows Phone in-app browser (for the same app on the same phone) when wrapped with Intel XDK or Apache Cordova works correctly - w3_getIsInternetExplorer returns TRUE, w3_getIsAndroid returns FALSE and also w3_getIsSafari also returns FALSE This is a Windows bug. I have reported this bug to Microsoft.
  23. How can I lock a SmartMS app to display in portrait mode, irrespective of the device orientation?
  24. I'm looking for simple SMARTMS code to detect the browser, operating system and device - to be used in a multi-platform mobile app.
  25. I have found demo code on http://stackoverflow.com/questions/18384170/using-smart-mobile-studio-to-interact-with-a-mysql-database and a hosted demo on http://www.lynkit.com.au/MySQL/ It works! Credit to Nico Wouterse Here is the code //PHP file to connect to MySQL and query for data <?php header("Access-Control-Allow-Origin: *"); $link = mysql_pconnect("www.your-domain.com", "your-db-user", "your-user-pw") or die("Could not connect"); mysql_select_db("your-mysql-db") or die("Could not select database"); $sql_statement = $_POST['sql_statement']; $arr = array(); $
×
×
  • Create New...