locked
LS HTMl Version info? RRS feed

  • Question

  • is it possible to get/display the Version info in a LS html Client?

    robert

    Thursday, November 14, 2013 2:41 PM

Answers

  • I will check if that detail is within the model, I don't recall it being there.

    Here is a more hard-coded approach that may suffice for your needs. From the code below retrieve all tags in the document that are based on a script tag, then enumerate each result to inspect location, compare for the name to msls then parse the version attributes.

    var scripts = document.getElementsByTagName("script");
    
    for(var i=0; i<scripts.length;++i) {
       location = scripts[i].src;
    
       // Check for msls.js in name, parse the version from it
    }
    



    Johnny Larue, http://www.softlandingcanada.com

    Saturday, November 16, 2013 1:47 PM

All replies

  • Hi,

    Yann has replied a similar question before and you may refer to it below:

    If you use the FullName method, you get "AssemblyName, Version=x.x.x.x, Culture=neutral, PubliKeyToken=null" (or similar).

    If you want just the version number, try:

    VB:

            Dim name = New AssemblyName(System.Reflection.Assembly.GetExecutingAssembly.FullName)
     
            Return name.Version.ToString
    

    C#:

    var name = new AssemblyName(System.Reflection.Assembly.GetExecutingAssembly().FullName);

    return name.Version.ToString();

    This'll give you JUST the version number, which is what I assume you wanted originally.

    You may get detailed information from:What is the right way to show version information in a LS app

    Please let me know if I have misunderstood you.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, November 15, 2013 9:14 AM
  • I Need this Information in the HTML Client on a page not at Server side...

    robert

    Friday, November 15, 2013 9:16 AM
  • I will check if that detail is within the model, I don't recall it being there.

    Here is a more hard-coded approach that may suffice for your needs. From the code below retrieve all tags in the document that are based on a script tag, then enumerate each result to inspect location, compare for the name to msls then parse the version attributes.

    var scripts = document.getElementsByTagName("script");
    
    for(var i=0; i<scripts.length;++i) {
       location = scripts[i].src;
    
       // Check for msls.js in name, parse the version from it
    }
    



    Johnny Larue, http://www.softlandingcanada.com

    Saturday, November 16, 2013 1:47 PM