WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#24544 closed defect (bug) (invalid)

404 error when using 2 scripts

Reported by: nielsniels2012 Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.5.1
Component: General Keywords:
Focuses: Cc:

Description (last modified by SergeyBiryukov)

Hello,

I need to use this code in my functions.php folder:

function wp_jquery_cdn_init(){
                if (!is_admin()){
                    wp_deregister_script('jquery');
                    wp_register_script('jquery', "http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js");
                    wp_enqueue_script('jquery');
                }
            }
            add_action('init', 'wp_jquery_cdn_init');

and this code in the post or page I want my Iframe:

<script type="text/javascript" src="http://energieleverancierkiezen.energievergelijken.nl/Scripts/iframe/widget.js"></script><iframe src="http://energieleverancierkiezen.energievergelijken.nl/nl/input/widget/" height="325" width="332"></iframe>

and im using the "iframe" plugin to let things work, but this plugin is not important for this bug. This is my website: http://www.energieleverancierkiezen.net/ when I try to use a plugin, for instance a social widget into my homepage it causes it to break.

I have on all my posts a social widget at the bottom of the post, for instance: http://www.energieleverancierkiezen.net/energieleveranciers-kiezen/

When I also activate this on pages, my homepage will break, because of this script on my homepage:

<script type="text/javascript" src="http://energieleverancierkiezen.energievergelijken.nl/Scripts/iframe/widget.js"></script><iframe src="http://energieleverancierkiezen.energievergelijken.nl/nl/input/widget/" height="325" width="332"></iframe>

But for letting that script work, I need also this script, like I said before:

<script type="text/javascript" src="http://energieleverancierkiezen.energievergelijken.nl/Scripts/iframe/widget.js"></script><iframe src="http://energieleverancierkiezen.energievergelijken.nl/nl/input/widget/" height="325" width="332"></iframe>

I've totally no clue why this problem occurs. I talked with the author of my theme, I talked with different plugin authors, but nobody has a clue why my homepage breaks. Everybody thinks it is something with wordpress.

My website only breaks on pages where I add the iframe (this code: <script type="text/javascript" src="http://energieleverancierkiezen.energievergelijken.nl/Scripts/iframe/widget.js"></script><iframe src="http://energieleverancierkiezen.energievergelijken.nl/nl/input/widget/" height="325" width="332"></iframe> and a social plugin or my live chat)

Thanks in advance,
Niels

Attachments (3)

home 1.1.PNG (544.6 KB) - added by nielsniels2012 2 years ago.
activating google+ or social widgets.PNG (78.6 KB) - added by nielsniels2012 2 years ago.
homepage breaks.PNG (537.4 KB) - added by nielsniels2012 2 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 @SergeyBiryukov2 years ago

  • Description modified (diff)

comment:2 @SergeyBiryukov2 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Please try the support forums for troubleshooting: http://wordpress.org/support/.

Feel free to reopen with steps to reproduce on a clean install if it turns out to be a bug in core.

@nielsniels20122 years ago

comment:3 @nielsniels20122 years ago

Hello Sergeybiryukov,

thanks for your fast reply. I did the steps on a clean install: http://afvallenzwangerschap.nl/

The only things I did:

  1. adding this code to my functions.php:

function wp_jquery_cdn_init(){

if (!is_admin()){

wp_deregister_script('jquery');
wp_register_script('jquery', "http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js");
wp_enqueue_script('jquery');

}

}
add_action('init', 'wp_jquery_cdn_init');

  1. adding this code to my homepage:

function wp_jquery_cdn_init(){

if (!is_admin()){

wp_deregister_script('jquery');
wp_register_script('jquery', "http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js");
wp_enqueue_script('jquery');

}

}
add_action('init', 'wp_jquery_cdn_init');

  1. install the "iframe" plugin
  1. downloading 2 social plugins and tried them both, with resulting my website to break. I added some screenshots of the proces.

You can also try it by yourself and you will see that your website breaks.

Note: See TracTickets for help on using tickets.