WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] ie crash my site (19 posts)

  1. xxhunterxx
    Member
    Posted 5 years ago #

    hello
    my site crash when using ie ( 7 8 ) in firefox work great ...
    it crash only when i add js code ..
    after searching and editing i have found that this code crash the site
    <?php $key="videoembed"; echo get_post_meta($post->ID, $key, true); ?>
    crash only when i add js code ..

    i use this code to embed video from megavideo ..

    how can i fix that ?

    tnx a lot

  2. xxhunterxx
    Member
    Posted 5 years ago #

    any !?

  3. Shane G
    Member
    Posted 5 years ago #

    Hi,

    After adding JS code..your blog is working in other browser like Firefox?

    Thanks,

    Shane G.

  4. xxhunterxx
    Member
    Posted 5 years ago #

    yes ..
    opera.. google chrome ..
    only ie crash ...
    i hate ie .. but the prob is that all my visitors use ie (6'7'8) .. i cant force them to use other browsers..

  5. Edde Beket
    Member
    Posted 5 years ago #

    The code you provide is just grabbing data from an extra field called "videoembed". I assume you have this field available in at least one post to embed video?

    Dunno, just guessing, but maybe your video player can't handle empty file locations? Or...

    A link to your site would be handy.

  6. Edde Beket
    Member
    Posted 5 years ago #

    If you use the embed code and replace the video url by the value from the extra field I see no clear reason why your site would crash.


    <object width="640" height="344"><param name="movie" value="http://www.megavideo.com/v/1a8763d06fec71ba32b7ac45887fd0ec2"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.megavideo.com/v/1a8763d06fec71ba32b7ac45887fd0ec2" type="application/x-shockwave-flash" allowfullscreen="true" width="640" height="344"></embed></object>

  7. Edde Beket
    Member
    Posted 5 years ago #

    Resulting in something like:


    <object width="640" height="344"><param name="movie" value="<?php $key='videoembed'; echo get_post_meta($post->ID, $key, true); ?>"></param><param name="allowFullScreen" value="true"></param><embed src="<?php $key='videoembed'; echo get_post_meta($post->ID, $key, true); ?>" type="application/x-shockwave-flash" allowfullscreen="true" width="640" height="344"></embed></object>

    I've put videoembed between different (single) quotes, to prevent the value to become value="<?php $key=" - after which it breaks.

  8. xxhunterxx
    Member
    Posted 5 years ago #

    its not empty file location ..
    all the posts use the code( all the psots have 1 video embeded )
    and i use the embed code

    i can use js only when i add the embed code to the post it self not the speciael key ..
    ex :
    embed code
    text bla bla bla

    no crashing ...

    text bla bla bla

    special key = videoembed --> embed code ..

    crash

    sorry for my bad english

  9. Edde Beket
    Member
    Posted 5 years ago #

    I think the following should do the trick, checking for data before embedding.


    <?php if ( get_post_meta($post->ID, "videoembed", true) ) : ?>
    <object width="640" height="344"><param name="movie" value="<?php echo get_post_meta($post->ID, 'videoembed', true); ?>"></param><param name="allowFullScreen" value="true"></param><embed src="<?php echo get_post_meta($post->ID, 'videoembed', true); ?>" type="application/x-shockwave-flash" allowfullscreen="true" width="640" height="344"></embed></object>
    <?php endif; ?>

    I dont't see what you mean by js. Could you provide me with a link to your site?

  10. xxhunterxx
    Member
    Posted 5 years ago #

    evry js code ( javascript ) like google ads ..
    i dont think that the code u have posted can help ..
    cause i copy all the embed code to the special field ( videoembed )
    or maybe it does what do i need to copy to the special field ?

  11. Edde Beket
    Member
    Posted 5 years ago #

    It might very well be the cause: the embed code contains a lot of quotes. Missing one that should have been escaped, will ruin your output.
    I'd go for the code as provided and changing the content of the videoembed field to the url of the movie. See what happens if yuo try that.

  12. MrCanuck89
    Member
    Posted 5 years ago #

    Do you happen to have google gears as an addon in your browser? if so try turning that off.

  13. xxhunterxx
    Member
    Posted 5 years ago #

    edde sory the site is down ( thats what happen when u buy reseller from kids )

    and MrCanuck89 .. no google gears no addons .. nothing
    the site crash for evry 1 .. i have noticed that to late .. i have more then 400 posts with embeded videos ..

  14. Edde Beket
    Member
    Posted 5 years ago #

    Testing is a little hard when your site isn't up and running. :)

  15. xxhunterxx
    Member
    Posted 5 years ago #

    ill test right now (: the site is back

  16. xxhunterxx
    Member
    Posted 5 years ago #

    doenst crash when adding only the url to special field ..
    but no video embeded ..

  17. Edde Beket
    Member
    Posted 5 years ago #

    Do you have a URL now?

  18. xxhunterxx
    Member
    Posted 5 years ago #

    sorry cant post the url
    so we khow that the embed code crash ie ):

  19. xxhunterxx
    Member
    Posted 5 years ago #

    k tnx guys .. fixed
    i have copied some js code from other theme to the header
    and it seems that doent crash anymore - wierd - hehehe

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags