[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 856
  • Last Modified:

Error 301

I am setting up a web page that our parent company sent me (from Spain), but I am a novice to web design and html.  When I open the htm link I get the following errors:
1.  Error con servidor: 301.  . Variable scorm: cmi.suspend_data
2.  Error con servidor: 301.  . Variable scorm: cmi.core.lesson_status (twice)
Then the page seems to load just fine.  I noticed that cmi.suspend_data and cmi.core.lesson_status are both referenced in javascript files.  Don't know if this helps.
0
MCPJ
Asked:
MCPJ
1 Solution
 
ZvonkoSystems architectCommented:
The http status code 301 does say: page moved (or simply: redirection)
That is for browser not an error code because browser does folow the redirection.
Now if you have some AJAX requests in that script files, like XmlHttp, then status code 301 is not handled automaticaly.
Do you see XmlHttp anywhere in your script?

0
 
MCPJAuthor Commented:
No, there's no mention of XmlHttp in any of the files.  Below is the scorm.js file.
var lesson_status_ini;
function Marcar_Iniciado(){
      LMSInitialize();
      lesson_status_ini = Val_Var("cmi.core.lesson_status");
      if ((lesson_status_ini == "completed") || (lesson_status_ini == "passed")  
            || (lesson_status_ini == "failed"))
           {}
      else
            Env_Var("cmi.core.lesson_status","incomplete");
      LMSFinish();
}
function Marcar_Finalizado(){
      LMSInitialize();
      lesson_status_ini = Val_Var("cmi.core.lesson_status");
      Env_Var("cmi.core.lesson_status","completed");
      LMSFinish();
}
function Val_Var(variable_scorm){
      var valor = LMSGetValue(variable_scorm);
      var cod_error = LMSGetLastError();
      if (cod_error != 0)
            Tratar_Error(cod_error, variable_scorm);
      return valor;
}
function Env_Var(variable_scorm,valor){
      var valor = LMSSetValue(variable_scorm, valor);
      var cod_error = LMSGetLastError();
      if (cod_error != 0)
            Tratar_Error(cod_error,variable_scorm);
}
function Tratar_Error(codigo,variable){
      var des_error = LMSGetErrorString(codigo);
      alert('Error con servidor: '+codigo+'. '+des_error+'. Variable scorm: '+variable);
}
0
 
hieloCommented:
The code supplied are simply helper functions, one of which is the one that logs/reports the error. Basically the error means "the webaddress that you requested was moved elsewhere". To get rid of the problem you need to figure out two things:
1. Where on the server is the file that you are looking for?
Once you locate it on the server, access it directly via the browser and if it load correctly, write down the URL for it.
2. Where in your javascript code are you calling that URL?
Once you locate the portion of your code where you are making this call, update the URL with the one recorded on step 1 above.

The supplied code is not calling the URL. It must be:
a. hardcoded elsewhere on some other script
b. since you seem to usin AJAX, perhaps you are getting the link from an AJAX request. If so, you must check the data that is coming from the AJAX request and see which data source contains the incorrect URL and update it there
c. a user input form or pop-up.  Not much you can do here, except notify the user of the updated link.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now