collapse

* User Info

 
 
Welcome, Guest. Please login or register.
Did you miss your activation email?

* Who's Online

  • Dot Guests: 58
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • Mstcool: Oh, ok, Sinan
    August 25, 2014, 10:19:15 PM
  • ArsenArsen: When i make them
    August 19, 2014, 12:20:20 AM
  • ArsenArsen: I had some mod ideas, i will put them.
    August 19, 2014, 12:19:45 AM
  • [SiNaN]: We could, but it's there as a reminder of some kind, that we should fill it in, somehow.
    August 18, 2014, 09:57:14 PM
  • Mstcool: Y don't u guys remove the customization section since it has no files?
    August 17, 2014, 10:27:28 PM
  • ArsenArsen: Ok, Great!
    August 15, 2014, 03:13:18 PM
  • [SiNaN]: We have the translators' names listed in the downloads area.
    August 15, 2014, 03:05:39 PM
  • ArsenArsen: Never Mind, i wont, noone did.
    August 15, 2014, 02:22:32 PM
  • ArsenArsen: Can i put mz name on translation
    August 15, 2014, 02:21:06 PM
  • [SiNaN]: You can only change your forum profile options once you have 5 posts. I have made an exception for Translator group though, so you should be able to do it now.
    August 13, 2014, 03:32:17 PM
  • ArsenArsen: Cant find where to change avatar
    August 13, 2014, 03:12:38 PM
  • ArsenArsen: Ok
    August 11, 2014, 05:17:55 AM
  • Underdog: there is a documentation link on your top-right
    August 10, 2014, 08:48:45 PM
  • ArsenArsen: What to use for docs? This is NoT SP support question.
    August 10, 2014, 02:55:55 PM
  • Ron-KK4HGY: Hello all!
    August 06, 2014, 03:22:50 PM
  • USFA: tada
    August 04, 2014, 09:49:45 PM
  • BCNPalomino: lol, that search doe :O
    July 18, 2014, 09:26:27 AM
  • RohailPro23: hi all
    July 18, 2014, 08:09:00 AM
  • samborabora: sorry, thought this was search, lol
    June 29, 2014, 04:45:12 AM
  • samborabora: sp_embed_image
    June 29, 2014, 04:45:01 AM

* Team Blog

* Recent Posts

Re: Easy one: Displaying an Action in a block by XaR
[September 01, 2014, 09:19:16 AM]


during installation asking for SFTP and error by coolsanth
[September 01, 2014, 07:17:03 AM]


Re: Easy one: Displaying an Action in a block by BurkeKnight
[September 01, 2014, 05:07:21 AM]


Re: Easy one: Displaying an Action in a block by andy
[September 01, 2014, 12:23:01 AM]


Re: Easy one: Displaying an Action in a block by BurkeKnight
[August 31, 2014, 03:55:27 PM]

Blocks speak! Do you have an interest in getting more blocks - or even making your own? The Blocks Board is for you!

Author Topic: Javascript no funciona en Pagina  (Read 1922 times)

0 Members and 1 Guest are viewing this topic.

Offline angelverde

  • Semi Newbie
  • *
  • Posts: 6
  • SMF Version: 1.1.11
  • SP Version: 2.3.2
Javascript no funciona en Pagina
« on: August 03, 2010, 04:24:31 AM »
Esta en uso SMF 1.1.11 con Simple Portal 2.3.2, el link del sitio es este

Me tomo horas para que un JavaScript me funcionara, lo estuve probando en esta pagina para probar modificaciones, cuando todo estuvo correcto fui al panel de Simple Portal y cree una nueva página tipo HTML, el problema esta en que el JS no funciona en ella.

Probe meter el JS antes de </head> y tampoco funciona, el link de la pagina creada es este si prueban los botones no verán algún cambio, cuando deberian cambiar los iframes.

El código de la página es este:
Code: [Select]
<a href="http://www.forosbuap.mx/chat/index.php" target="popup" onclick="window.open(this.href, 'chat', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=760px,height=550px');this.blur();return false;"><b>Ver el Chat en Ventana nueva</b></a>
<br />
<p>
<b>Disfruta de nuestra Programación</b>
<div class="smalltext">Prueba las estaciones de Grupo Acir, de Radio BUAP o películas en Streaming.<br /> Solo diviertete, aunque también puedes cerrar todo, da clic en el botón que más te guste:</div>

<script language="JavaScript" type="text/javascript">
<!--
function crearFrame(val, anc, alt) {
    var testFrame = document.createElement("IFRAME");
    testFrame.id = "contenidos";
    testFrame.src = val;
    testFrame.width = anc;
    testFrame.height = alt;
    testFrame.frameborder = "0";
    testFrame.scrolling = "no";
    var control = document.getElementById(testFrame.id)
    document.body.removeChild(control);
    document.body.appendChild(testFrame);

//-->
</script>
<form>
<input type="button" value="Silencio" onclick="crearFrame('nada.html', '1', '1')"/>
<input type="button" value="Grupo Acir" onclick="crearFrame('http://www.grupoacir.com.mx/multimedia/audio/radio/flash/mixquer.php', '500', '400')"/>
<input type="button" value="Radio BUAP" onclick="crearFrame('http://www.enciendetv.buap.mx/paginas/2510.asp?canal=1', '550', '400')"/>
</form>
</p>
<br />
<iframe  id="contenidos"
   frameborder="0"
   width="500"
   scrolling="no"
   height="400"
   src="http://www.grupoacir.com.mx/multimedia/audio/radio/flash/mixquer.php">
</iframe>

Cualquier sugerencia es bienvenida.
« Last Edit: August 03, 2010, 01:08:25 PM by angelverde »

Offline angelverde

  • Semi Newbie
  • *
  • Posts: 6
  • SMF Version: 1.1.11
  • SP Version: 2.3.2
Re: Javascript no funciona en Pagina
« Reply #1 on: August 03, 2010, 04:48:21 AM »
 :( :'(
Creo que mi JavaScript no funciona dentro de un <div> y por ahora ya estoy agotado para investigar, ojala me pudieran orientar un poco  :|

Offline 130860

  • Super Handsome Language Coordinator
  • Board Moderators
  • *
  • Posts: 1777
  • Gender: Male
  • You and I are not the same class of pirate!
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Javascript no funciona en Pagina
« Reply #2 on: August 03, 2010, 09:11:46 AM »
tu codigo está mal, revisalo, asegurate e que llame a el iframe correcto o en su caso que apunte a el frame correspondiente.

Offline angelverde

  • Semi Newbie
  • *
  • Posts: 6
  • SMF Version: 1.1.11
  • SP Version: 2.3.2
Re: Javascript no funciona en Pagina
« Reply #3 on: August 03, 2010, 01:04:12 PM »
Revise que llame al iframe correcto y lo hace, solo que soy nuevo en JS y no se porque no funciona cuando esta dentro de un div.

Me pondre a estudiar/investigar si sabes algo por favor no dudes en comentarlo.

Offline angelverde

  • Semi Newbie
  • *
  • Posts: 6
  • SMF Version: 1.1.11
  • SP Version: 2.3.2
Re: Javascript no funciona en Pagina
« Reply #4 on: August 03, 2010, 03:35:11 PM »
Lo solucione metiendo el iframe en un div y luego usando este JS

Code: [Select]
<script language="JavaScript" type="text/javascript">
<!--
function crearFrame(url, anch, alt) {

  document.getElementById ("miDiv").innerHTML = "<iframe frameborder=0 scrolling=no width=" + anch + " height=" + alt + " src=" + url + "></iframe>";
  }
//-->
</script>

Vaya solucion que encontre :P