Ver Mensaje Individual
  #3 (permalink)  
Antiguo 10/09/2011, 10:13
Avatar de JuJoGuAl
JuJoGuAl
 
Fecha de Ingreso: julio-2009
Ubicación: Venezuela
Mensajes: 754
Antigüedad: 14 años, 8 meses
Puntos: 19
Respuesta: No se ejecuta JavaScript si pego otro

Código Javascript:
Ver original
  1. table+ "</tr>";
  2.   }
  3.   table+=" </table>";
  4.   insHTML(table)
  5.  }
  6. }
  7. function doWin(URL) {
  8.  ppw=wn.open(URL,'popWhizz','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=640,height=480,top=100');
  9.  ppw.focus();
  10. }
  11. function spellCheck(){
  12.  try {
  13.   var axo=new ActiveXObject("ieSpell.ieSpellExtension");
  14.   axo.CheckAllLinkedDocuments(document);
  15.  } catch(e) {
  16.   if(e.number==-2146827859) {
  17.   if(confirm("ieSpell is not installed on your computer. \n Click [OK] to go to download page."))
  18.    {wn.open("http://www.iespell.com/download.php","DownLoad")}
  19.   }else{
  20.    alert("Error Loading ieSpell: Exception " + e.number)
  21.   }
  22.  }
  23. }
  24. function getWinSize(){
  25.  var winW=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:document.body.clientWidth;
  26.  var winH=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight;
  27.  return {w:winW,h:winH}
  28. }
  29. function fullscreen() {  //Enable or disable fullscreen
  30.  var container=o("CONTAINER"+idTa);
  31.  if(!isFullscreen()) {
  32.   if(document.body.style.overflow){document.body.style.overflow="hidden";}else{document.documentElement.style.overflow="hidden";}
  33.   document.body.style.visibility="hidden";
  34.   container.style.visibility="visible"
  35.   container.style.position="absolute";
  36.   container.style.top=(window.pageYOffset?window.pageYOffset:document.body.scrollTop?document.body.scrollTop:document.documentElement.scrollTop) + "px";
  37.   container.style.left="0";
  38.   container.style.width=getWinSize().w+"px";
  39.   container.style.height=getWinSize().h+"px";
  40.   o("whizzy"+idTa).style.backgroundColor="#fff";
  41.   o("whizzy"+idTa).style.height=getWinSize().h-o("CONTROLS"+idTa).offsetHeight+"px";
  42.  }
  43.  else {
  44.   if(document.body.style.overflow){document.body.style.overflow="visible";}else{document.documentElement.style.overflow="";}
  45.   document.body.style.visibility="visible";
  46.   container.style.position="relative";
  47.   container.style.top=o(idTa).style.top?o(idTa).style.top:"0px";
  48.   container.style.left=o(idTa).style.left?o(idTa).style.left:"0px";
  49.   container.style.width=taOrigSize[idTa].w;
  50.   container.style.height="auto";
  51.   o("whizzy"+idTa).style.backgroundColor="transparent";
  52.   o("whizzy"+idTa).style.height=taOrigSize[idTa].h;
  53.  }
  54. }
  55. function getDir() { //Detect current whizzywig directory
  56.  var base=location.href,e=document.getElementsByTagName('base'),i;
  57.  for(i=0;i<e.length;i++){
  58.   if(e[i].href){base = e[i].href}
  59.  }
  60.  e=document.getElementsByTagName('script');
  61.  for(i=0;i<e.length;i++) {
  62.   if(e[i].src && /(^|\/)whizzywig\.js([?#].*)?$/i.test(e[i].src)){
  63.    return e[i].src.replace(/whizzywig\.js/i.exec(e[i].src),'')
  64.   }
  65.   else if(e[i].src && /(^|\/)whizzywig[^\/].*?\.js([?#].*)?$/i.test(e[i].src)){
  66.    return e[i].src.replace(/whizzywig[^\/].*?\.js/i.exec(e[i].src), '')
  67.   }
  68.  }
  69.  return '';
  70. }
  71. function isFullscreen(){
  72.  if(o("CONTAINER"+idTa).style.width==getWinSize().w+"px"){return true}
  73.  return false
  74. }
  75. function hideDialogs() {
  76.  h('LINK_FORM'+idTa); h('IMAGE_FORM'+idTa); h('COLOR_FORM'+idTa); h('TABLE_FORM'+idTa); h('TABLE_CONTROLS'+idTa);
  77. }
  78. function showDesign(){
  79.  oW.document.body.innerHTML=tidyD(o(idTa).value);
  80.  h(idTa); h('showWYSIWYG'+idTa); s('CONTROLS'+idTa); s('whizzy'+idTa);
  81.  if(o("whizzy"+idTa).contentDocument){o("whizzy"+idTa).contentDocument.designMode="on"}
  82.  oW.focus()
  83. }
  84. function showHTML(){
  85.  o(idTa).value=tidyH(oW.document);
  86.  h('CONTROLS'+idTa); h('whizzy'+idTa); s(idTa); s('showWYSIWYG'+idTa);
  87.  if(isFullscreen()){
  88.   o(idTa).style.width=getWinSize().w+"px";
  89.   o(idTa).style.height=(getWinSize().h-o('showWYSIWYG'+idTa).offsetHeight)+"px";
  90.   o(idTa).style.borderWidth = "0px"
  91.  }else{
  92.   o(idTa).style.position="relative";
  93.   o(idTa).style.width=taOrigSize[idTa].w;
  94.   o(idTa).style.height=taOrigSize[idTa].h;
  95.   o(idTa).style.borderWidth="1px"
  96.  }
  97.  o(idTa).focus()
  98. }
  99.  
  100. function syncTextarea(){//tidy up before we go-go
  101.  for (var i=0;i<whizzies.length;i++){
  102.   var t=whizzies[i];
  103.   var d=o("whizzy"+t).contentWindow.document;
  104.   if (o(t).style.display=='block'){d.body.innerHTML=o(t).value}
  105.   var ret=(o(t).nodeName!="TEXTAREA") ? o('wzhid_'+o(t).id) : o(t);
  106.   ret.value=tidyH(d)
  107.  }
  108. }
  109. function cleanUp(){xC("removeformat",null); tidyH(oW.document)}
  110. function tidyD(h){//FF designmode likes <B>,<I>...
  111.  h=h.replace(/<(\/?)strong([^>]*)>/gi,"<$1B$2>").replace(/<(\/?)em>/gi,"<$1I>");
  112.  return h
  113. }
  114. function tidyH(d){//attempt valid xhtml
  115.  function lc(str){return str.toLowerCase()}
  116.  function qa(str){return str.replace(/(\s+\w+=)([^"][^>\s]*)/gi,'$1"$2"');}
  117.  function sa(str){return str.replace(/("|;)\s*[A-Z-]+\s*:/g,lc);}
  118.  var sz=['medium','xx-small','x-small','small','medium','large','x-large','xx-large'],
  119.  fs=d.getElementsByTagName("FONT"),i,ih;
  120.  for (i=0;i<fs.length;i++){
  121.   if (fs[i].face) {fs[i].style.fontFamily = fs[i].face; fs[i].removeAttribute('face')}
  122.   if (fs[i].size) {fs[i].style.fontSize = sz[fs[i].size]; fs[i].removeAttribute('size')}
  123.   if (fs[i].color) {fs[i].style.color = fs[i].color; fs[i].removeAttribute('color')}
  124.  }
  125.  ih=d.body.innerHTML;
  126.  ih=ih.replace(/(<\/?)FONT([^>]*)/gi,"$1span$2")
  127.  .replace(/(<\/?)[B](\s+[^>]*)?>/gi, "$1strong$2>")
  128.  .replace(/(<\/?)[I](\s+[^>]*)?>/gi, "$1em$2>")
  129.  .replace(/<\/?(COL|XML|ST1|SHAPE|V:|O:|F:|F |PATH|LOCK|IMAGEDATA|STROKE|FORMULAS)[^>]*>/gi, "")
  130.  .replace(/\bCLASS="?(MSOw*|Apple-style-span)"?/gi,"")
  131.  .replace(/<[^>]+=[^>]+>/g,qa) //quote all atts
  132.  .replace(/<(TABLE|TD|TH|COL)(.*)(WIDTH|HEIGHT)=["'0-9A-Z]*/gi, "<$1$2")//no fixed size tables (%OK) [^A-Za-z>]
  133.  .replace(/<([^>]+)>\s*<\/\1>/g, "")
  134.  .replace(/><(H|P|D|T|BLO|FOR|IN|SE|OP|UL|OL|LI|SC)/gi,">\n<$1")adjacent blocks
  135.  .replace(/(<BR ?\/?>)([^\r\n])/gi,"$1\n$2")
  136.  .replace(/([^\n])<(P|DIV|TAB|FOR)/gi,"$1\n\n<$2")
  137.  .replace(/([^\n])<\/(UL|OL|DL|DIV|TAB|FOR)/gi,"$1\n</$2")
  138.  .replace(/([^\n])(<\/TR)/gi,"$1\n $2") //end row
  139.  .replace(/\n<(BLO|LI|OP|TR|IN|DT)/gi,"\n <$1")
  140.  .replace(/\n<(TD|TH|DD)/gi,"\n  <$1")
  141.  .replace(window.location.href+'#','#')
  142.  .replace(/<(IMG|INPUT|BR|HR|LINK|META)([^>]*)>/gi,"<$1$2 />")
  143.  .replace(/(<\/?[A-Z]*)/g,lc)
  144.  .replace(/STYLE="[^"]*"/gi,sa);
  145.  return ih
  146. }
  147. function kb_handler(e){
  148.  var cmd=false, prm=false,k;
  149.  if(e && (e.ctrlKey && e.keyCode==e.DOM_VK_V)||(e.shiftKey && e.keyCode==e.DOM_VK_INSERT))
  150.   {setTimeout('cleanUp()',10)}
  151.  else if(e && e.keyCode==13 && !e.shiftKey &&papa.nodeName=="BODY"){cmd="formatblock";prm="<p>"}
  152.  else if(e && e.ctrlKey){
  153.   k=String.fromCharCode(e.charCode).toLowerCase();
  154.   cmd=(k=='b')?'bold':(k=='i')?'italic':(k=='l')?'link':(k=='m')?'image':false;
  155.  }
  156.  if(cmd){
  157.   makeSo(cmd,prm);
  158.   e.preventDefault();
  159.   e.stopPropagation()
  160.  }
  161. }
  162. function doTag(html){
  163.  var url,close='',before,after;
  164.  if(!html){html=prompt("Enter some HTML or text to insert:", "")}
  165.  o(idTa).focus();
  166.  if(html=='<a>'){
  167.   url=prompt("Link address:","http://");
  168.   html='<a href="'+url+'">'
  169.  }
  170.  if(html=='<img>'){
  171.   url=prompt("Address of image:","http://");
  172.   var alt=prompt("Description of image");
  173.   html ='<img src="'+url+'" alt="'+alt+'">';
  174.  }
  175.  if(html.indexOf('<')===0 && html.indexOf('br') != 1 && html.indexOf('img') != 1)
  176.   {close=html.replace(/<([a-z0-6]+).*/,"<\/$1>")}
  177.  if(html != '<strong>' && html != '<em>'){close+='\n'}
  178.  if (document.selection){
  179.   sel=document.selection.createRange();
  180.   sel.text=html+sel.text+close
  181.  }else{
  182.    before=o(idTa).value.slice(0,o(idTa).selectionStart);
  183.    sel=o(idTa).value.slice(o(idTa).selectionStart,o(idTa).selectionEnd);
  184.    after=o(idTa).value.slice(o(idTa).selectionEnd);
  185.    o(idTa).value =before+html+sel+close+after
  186.  }
  187.  o(idTa).focus()
  188. }
  189. function insHTML(html){//insert HTML at current selection
  190.  if(!html){html=prompt(t("Enter some HTML or text to insert:"), "")}
  191.  if(html.indexOf('js:')===0){
  192.   try{eval(html.replace(/^js:/,''))} catch(e){}
  193.   return
  194.  }
  195.  whereAmI();
  196.  try {xC("inserthtml",html+sel)}
  197.  catch(e){if (document.selection) {
  198.   if(papa&&papa.nodeName=='IMG'){papa.outerHTML=html+papa.outerHTML;}
  199.   else if(rng){rng.select(); rng.pasteHTML(html+rng.htmlText)}
  200.  } }
  201. }
  202. function whereAmI(e){
  203.  if(!e){e=wn.event}
  204.  var mu=e&&e.type=='mouseup',pa,id;
  205.  if (msIE){
  206.   oW.document.getElementsByTagName("body")[0].focus();
  207.   sel=oW.document.selection;
  208.   rng=sel.createRange();
  209.   papa=mu?e.srcElement:(sel.type == "Control")?rng.item(0):rng.parentElement();
  210.  }else{
  211.   sel=oW.getSelection();sn=sel.anchorNode;
  212.   papa=mu?e.target:(sn.nodeName == '#text')?sn.parentNode:sn;
  213.  }
  214.  pa=papa;
  215.  trail=papa.nodeName;
  216.  while(!pa.nodeName.match(/^(HTML|BODY)/) && pa.className!="wzCtrl"){
  217.   pa=pa.parentNode;
  218.   trail=pa.nodeName+'>'+trail
  219.  }
  220.  if(pa.className=="wzCtrl"){trail=sel=rng=null}
  221.  id=pa.nodeName=="HTML" ? pa.getElementsByTagName("BODY")[0].id : pa.id.replace("CONTROL","");
  222.  c(id);
  223.  wn.status=id+":"+trail;
  224.  if(trail.indexOf('TABLE')>0){s('TABLE_CONTROLS'+idTa)}else{h('TABLE_CONTROLS'+idTa)}
  225. }
  226. function c(id){//set current whizzy
  227.  if(id==="" || whizzies.join().indexOf(id)=='-1'){return}
  228.  if (id!=idTa){
  229.   idTa=id;
  230.   try {oW=o("whizzy"+id).contentWindow;} catch(e){alert('set current: '+id)}
  231.   if(oW){if(oW.focus){oW.focus()}wn.status=oW.document.body.id}
  232.  }
  233. }
  234. function w(str,finalize){
  235.  if(!w.temp){w.temp=""}
  236.  w.temp+=str;
  237.  if(finalize){
  238.   o("CONTAINER"+idTa).innerHTML+=w.temp;
  239.   w.temp=""
  240.  }
  241. }
  242. function textSel(){if(sel && sel.type != "None" && sel.type != "Caret"){return true}else{alert(t("Select some text first")); return false}}
  243. function s(id){o(id).style.display='block'}
  244. function h(id){o(id).style.display='none'}
  245. function o(id){return document.getElementById(id)}//get element by ID
  246. function t(key){return (wn.language && language[key]) ? language[key] :  key;}

Alguien podria decirme que esta pasando? Porque no hay el probleman