Javascript link not working


I have javascript code to

1.get the URL of the current page

This is split and put into an array

2. Extract first part of URL

this will be the client name used for there LMS portal

3. Combine to make new URL

This will be added to the final quiz button to take them back to the relevent section of their LMS

This is the part of the code that isn't working, when we click on the link nothing happens.

The attached is a screenshot showing the SL text Vars:

The code is below:

/////////this is called when timeline starts//////////////////////////////////

var player = GetPlayer();

var path = window.location.href;
var array = path.split("");
var newName = array[0];

player.SetVar("courseExpired", path);
player.SetVar("courseExpired2", array[0]);
player.SetVar("URLClient", newName + "");

///////////////this is called when user clicks go to quiz button//////////

var url = newName+"";, '_blank');

//////////note: this works if I set var newName = "http://elearning"////////

 If anyone has any suggestions?




Be the first to reply