yoxigen-zz / yoxview

1 stars 0 forks source link

Javascript error #1

Open pat-carrez opened 5 years ago

pat-carrez commented 5 years ago

Hello

I have an error in my javascript code that I can not understand not having enough knowledge ...

Uncaught TypeError: $(...).yoxview is not a function at yoxview-init.js:35

Thanks for your help ! Patricia

pat-carrez commented 5 years ago

Here is the complete code : `var yoxviewPath = getYoxviewPath(); var cssLink = top.document.createElement("link"); cssLink.setAttribute("rel", "Stylesheet"); cssLink.setAttribute("type", "text/css"); cssLink.setAttribute("href", yoxviewPath + "yoxview.css"); top.document.getElementsByTagName("head")[0].appendChild(cssLink);

function LoadScript(url) { document.write( '<scr' + 'ipt type="text/javascript" src="' + url + '"><\/scr' + 'ipt>' ) ; }

var jQueryIsLoaded = typeof jQuery != "undefined";

if (!jQueryIsLoaded) LoadScript("http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js");

LoadScript(yoxviewPath + "jquery.yoxview-2.2.min.js");

function getYoxviewPath() { var scripts = document.getElementsByTagName("script"); var regex = /(.*\/)yoxview-init/i; for(var i=0; i<scripts.length; i++) { var currentScriptSrc = scripts[i].src; if (currentScriptSrc.match(regex)) return currentScriptSrc.match(regex)[1]; }

return null;

} // Remove the next line's comment to apply yoxview without knowing jQuery to all containers with class 'yoxview': LoadScript(yoxviewPath + "yoxview-nojquery.js"); $(document).yoxview();`