Forum Discussion

cblown's avatar
cblown
Boss
12 years ago

Problem noted with ?device-view=mobile LITHIUM object

Hi guys

 

When we use ?device-view=mobile we note that the LITHIUM javascript object is not loaded / included, which results in a javascript error.

Uncaught ReferenceError: LITHIUM is not defined

 

This appears to be related to a missing include when this mode is activated. The following line is included when using a browser user-agent swticher set to iPhone. When using only ?device-view=mobile this line magically dissappears meaning that LITHIUM is undefined although the mobile view is shown. Basically this means any javascript running in the mobile view stops dead.

 

<script type="text/javascript" src="https://xxx.xxx.xxx/t5/scripts/6640BDDF24FE41C36D8A4993E5EFE179/lia-scripts-head-min.js"></script> 

 

If you are going to advertise device-view=mobile to clients its important that it works the same as a user-agent switcher and provides a true mobile view, otherwise we'll continue to get defect reports from clients who are trying to test mobile views using this trick.

 

Thanks

 

 

  • Hi,

     

    Please note that testing the mobile view using the "?device-view=mobile" parameter in the browser will disable Javascript, so the variable will not be available. You will need to either use a mobile device or change the user agent string of the browser (the easiest is test this on safari with the Developer menu).

  • JasonL's avatar
    JasonL
    Lithium Alumni (Retired)

    Hi Chris,

    When i tried with lithosphere with device-view=mobile flag, i don't see the javascript error.

     

    But i reckon i know which Customer your referring to.

     

    Took a quick look and when you click on the error, it seems to point to their omniture code

     

    var map = 
    	{
    	'all': 
    		{  
    			'prop67'	:	breadcrumbArray.join(':').replace(":" + leafCrumb,""), 							
    			'prop68'	:	leafCrumb, 									
    			'prop70'	:	LITHIUM.CommunityJsonObject.User.login, 					
    Uncaught ReferenceError: LITHIUM is not defined
    			'eVar65'	:	LITHIUM.CommunityJsonObject.User.login,
    			'events'	:	'event88'
    		},

     Someone from Product should confirm - i'm not sure why the lia-scripts-min.js file is not included for mobile 

     

     Maybe try replacing that line for user login? (sorry a little stretched didn't have time to try - perhaps something like this ${user.login}? )

    • ChiaraS's avatar
      ChiaraS
      Lithium Alumni (Retired)

      Hi,

       

      Please note that testing the mobile view using the "?device-view=mobile" parameter in the browser will disable Javascript, so the variable will not be available. You will need to either use a mobile device or change the user agent string of the browser (the easiest is test this on safari with the Developer menu).

      • cblown's avatar
        cblown
        Boss

        Thanks for the reply.

         

        Whether JS is being disabled in this mode by removing the include is really not the point, the main point of the post is that ?device-view=mobile isn't actually a fully compatible mobile view (like a user-agent switcher) and thus should be offered to clients with the included caveat that some functions may not work.

         

        We continue to get defect reports from clients using this feature which run perfectly fine on a mobile device and its difficult to explain to them why it doesn't work using ?device-view=mobile since according to the Lithium docs it should just work.