Jump to content
  • 0

Валидность JavaScript в html документе


vadimcucherencko
 Share

Question

Помогите пожалуста исправить ошибку с валидацией. Есть облако тегов реализованное с помощь JavaScript, все ошибки исправил осталось иправить ещё одну.

h_1315725992_6709395_313cb276ae.jpeg

А вот сам скрипт:

<script type="text/javascript"> 
function myTags(mytags){
mytags=mytags//<![CDATA[.replace(/<A/g, '<a')//]]>
//<![CDATA[.replace(/\/A>/g, "/a>")//]]>
//<![CDATA[.replace(/(\starget=_)(\w*)/g, ' target="_$2"')//]]>
//<![CDATA[.replace(/(\sclass=)(?!")(\w*)/g, ' class="$2"')//]]>
//<![CDATA[.replace(/(\sname=)(?!")(\w*)/g, ' name="$2"')//]]>
//<![CDATA[.replace(/(\sid=)(?!")(\w*)/g, ' id="$2"')//]]>
//<![CDATA[.replace(/(\srel=)(?!")(\w*)/g, ' rel="$2"');//]]>
mytags=encodeURIComponent(mytags)//<![CDATA[.replace(/!/g, '%21')//]]>
.replace(/'/g, '%27')//<![CDATA[.replace(/\(/g, '%28')//]]>
.replace(/\)/g, '%29')//<![CDATA[.replace(/\*/g, '%2A');//]]>
var rnumber = Math.floor(Math.random()*9999999);
var flashvars = {
tcolor:"0x2A62C8",
tcolor2:"0x000000",
hicolor:"0xB12AC8",
tspeed:"180",
distr:"true",
mode:"tags",
tagcloud:mytags
};
var params = {
allowScriptAccess:"always",
wmode:'transparent'
};
var attributes = {
id:"flash_cloud"
};
swfobject.embedSWF("tagcloud.swf?r="+rnumber,
"tags", "400", "220", "9.0.0",
"expressInstall.swf", flashvars,
params, attributes);
}

window.onload=function(){
var mytags="<tags>"
+document.getElementById('tags').innerHTML
+"</tags>";
myTags(mytags);
};
</script>

Edited by vadimcucherencko
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Спасибо Vlad за помощь подключил в отдельный файл, всё класс!!, так даже намного лучше да и код поменьше в документе, ведь это плюс для поискового робота.

Edited by vadimcucherencko
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy