Deprecated: Assigning the return value of new by reference is deprecated in /home/controlz/public_html/blog/wp-settings.php on line 472

Deprecated: Assigning the return value of new by reference is deprecated in /home/controlz/public_html/blog/wp-settings.php on line 487

Deprecated: Assigning the return value of new by reference is deprecated in /home/controlz/public_html/blog/wp-settings.php on line 494

Deprecated: Assigning the return value of new by reference is deprecated in /home/controlz/public_html/blog/wp-settings.php on line 530

Strict Standards: Declaration of Walker_Page::start_lvl() should be compatible with Walker::start_lvl(&$output) in /home/controlz/public_html/blog/wp-includes/classes.php on line 594

Strict Standards: Declaration of Walker_Page::end_lvl() should be compatible with Walker::end_lvl(&$output) in /home/controlz/public_html/blog/wp-includes/classes.php on line 594

Strict Standards: Declaration of Walker_Page::start_el() should be compatible with Walker::start_el(&$output) in /home/controlz/public_html/blog/wp-includes/classes.php on line 594

Strict Standards: Declaration of Walker_Page::end_el() should be compatible with Walker::end_el(&$output) in /home/controlz/public_html/blog/wp-includes/classes.php on line 594

Strict Standards: Declaration of Walker_PageDropdown::start_el() should be compatible with Walker::start_el(&$output) in /home/controlz/public_html/blog/wp-includes/classes.php on line 611

Strict Standards: Declaration of Walker_Category::start_lvl() should be compatible with Walker::start_lvl(&$output) in /home/controlz/public_html/blog/wp-includes/classes.php on line 705

Strict Standards: Declaration of Walker_Category::end_lvl() should be compatible with Walker::end_lvl(&$output) in /home/controlz/public_html/blog/wp-includes/classes.php on line 705

Strict Standards: Declaration of Walker_Category::start_el() should be compatible with Walker::start_el(&$output) in /home/controlz/public_html/blog/wp-includes/classes.php on line 705

Strict Standards: Declaration of Walker_Category::end_el() should be compatible with Walker::end_el(&$output) in /home/controlz/public_html/blog/wp-includes/classes.php on line 705

Strict Standards: Declaration of Walker_CategoryDropdown::start_el() should be compatible with Walker::start_el(&$output) in /home/controlz/public_html/blog/wp-includes/classes.php on line 728

Strict Standards: Redefining already defined constructor for class wpdb in /home/controlz/public_html/blog/wp-includes/wp-db.php on line 306

Deprecated: Assigning the return value of new by reference is deprecated in /home/controlz/public_html/blog/wp-includes/cache.php on line 103

Strict Standards: Redefining already defined constructor for class WP_Object_Cache in /home/controlz/public_html/blog/wp-includes/cache.php on line 425

Deprecated: Assigning the return value of new by reference is deprecated in /home/controlz/public_html/blog/wp-includes/query.php on line 21

Deprecated: Assigning the return value of new by reference is deprecated in /home/controlz/public_html/blog/wp-includes/theme.php on line 623

Strict Standards: Redefining already defined constructor for class WP_Dependencies in /home/controlz/public_html/blog/wp-includes/class.wp-dependencies.php on line 15

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/controlz/public_html/blog/wp-settings.php:472) in /home/controlz/public_html/blog/wp-content/plugins/si-captcha-for-wordpress/si-captcha.php on line 31

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/controlz/public_html/blog/wp-settings.php:472) in /home/controlz/public_html/blog/wp-content/plugins/si-captcha-for-wordpress/si-captcha.php on line 31

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method GoogleSitemapGeneratorLoader::Enable() should not be called statically in /home/controlz/public_html/blog/wp-includes/plugin.php on line 311
funcion javascript para Simular un click | formatic.cat

funcion javascript para Simular un click


Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056
JAVASCRIPT:
  1. /* ***********************************************************************************
  2. * SimularClick: Simular un click en un objeto.
  3. *   idObjecte : objecte sobre el cual se aplica el evento click
  4. * ***********************************************************************************/
  5.  
  6. function SimularClick(idObjete){
  7.  
  8. var nouEvent = document.createEvent("MouseEvents");
  9. nouEvent.initMouseEvent("click", true, true, window,0, 0, 0, 0, 0, false, false, false, false, 0, null);
  10.  
  11. var objecte = document.getElementById(idObjete);
  12. var canceled = !objecte.dispatchEvent(nouEvent);
  13. }

Etiquetas: , ,

11 comentarios para “funcion javascript para Simular un click”


  1. Deprecated: Function ereg() is deprecated in /home/controlz/public_html/blog/wp-content/plugins/google-analyticator/google-analyticator.php on line 399
    Antonio dice:

    Muy buena funcion!! almenos en FF que es dondel o necesitaba funciono perfecto, me saco de apuros XP


  2. Deprecated: Function ereg() is deprecated in /home/controlz/public_html/blog/wp-content/plugins/google-analyticator/google-analyticator.php on line 399
    edu dice:

    Me alegro de que te haya sido útil. Hasta la próxima!


  3. Deprecated: Function ereg() is deprecated in /home/controlz/public_html/blog/wp-content/plugins/google-analyticator/google-analyticator.php on line 399
    dmontero7 dice:

    Agradecimiento a quien agradecimiento merece, excelente codigo, justo lo que andaba buscando, lastima que no logre solucionar mi problema. Pero por lo menos ya se que no es asi.
    Gracias


  4. Deprecated: Function ereg() is deprecated in /home/controlz/public_html/blog/wp-content/plugins/google-analyticator/google-analyticator.php on line 399
    Jairo dice:

    Podría alguien modificar el codigo para que funcione tambien en IE.?


  5. Deprecated: Function ereg() is deprecated in /home/controlz/public_html/blog/wp-content/plugins/google-analyticator/google-analyticator.php on line 399
    cristian dice:

    Jairo,

    Para que funcione en Explorer, tienes que saber que solo hace falta cambiar la palabra "click" por "onClick" en la frase:

    nouEvent.initMouseEvent("onClick", true, true, window,0, 0, 0, 0, 0, false, false, false, false, 0, null);

    Debido a que Internet explorer, para crear un evento usa distinta nomenclatura.

    si te funciona dinoslo, sinó, te prepararé el código.

    saludos.


  6. Deprecated: Function ereg() is deprecated in /home/controlz/public_html/blog/wp-content/plugins/google-analyticator/google-analyticator.php on line 399
    eskuku dice:

    que es lo que tengo que cambiar en este codigo???


  7. Deprecated: Function ereg() is deprecated in /home/controlz/public_html/blog/wp-content/plugins/google-analyticator/google-analyticator.php on line 399
    fran gomez dice:

    Muchas gracias por el aporte. Nunca comento ningún post a no ser que de verdad lo vea útil. ;)


  8. Deprecated: Function ereg() is deprecated in /home/controlz/public_html/blog/wp-content/plugins/google-analyticator/google-analyticator.php on line 399
    user dice:

    Esto funciona asi:

    function SimularClick(idObjete){
    idObjete.click();
    }

    SimularClick(document.getElementById('boton'));


  9. Deprecated: Function ereg() is deprecated in /home/controlz/public_html/blog/wp-content/plugins/google-analyticator/google-analyticator.php on line 399
    nervtown dice:

    en ie me funcion al pelo
    var objecte = document.getElementById("ctl00_SheetContentPlaceHolder_cmdbuscarArti");
    objecte.click();

    muchisimas gracias!!!


  10. Deprecated: Function ereg() is deprecated in /home/controlz/public_html/blog/wp-content/plugins/google-analyticator/google-analyticator.php on line 399
    COLORATE dice:

    Justo lo que necesitaba .. Muchas gracias.

    De todas formas, esto me funciona perfectamente en Chrome pero en Firefox e Internet Explorer .. no tira..

    Alguna opción?...

    Gracias.


  11. Deprecated: Function ereg() is deprecated in /home/controlz/public_html/blog/wp-content/plugins/google-analyticator/google-analyticator.php on line 399
    mario dice:

    pue yo hice lo siguiente pero no funciona en el navegador de google.

    var idtag;
    function hacerclick(){
    idtag=document.getElementById('abrir');
    idtag.click();
    return idtag;
    }
    setTimeout("hacerclick('idtag')",3000);

Deja un comentario

CAPTCHA Image Audio Version
Reload Image