JavaScriptテックラボ

jQueryのloadで文字化けする場合の対処

2013年7月4日

jQueryで外部ファイルを読み込む際はload()メソッドを使いますが、デフォルト文字コードはUTF-8なので、Shift-JISであったりすると文字化けが発生します。
UTF-8でエンコードしておくのが一番ですが、そうもいかない時はxhr.overrideMimeType()に文字コードを指定してあげます。

関連記事

Comment

  1. Every weekend i used to visit this site, for the reason that i wish for
    enjoyment, for the reason that this this site conations in
    fact fastidious funny stuff too.

  2. What i do not understood is in reality how you are no longer really much more neatly-appreciated than you may be
    now. You're very intelligent. You know thus significantly in the case of this subject, made me personally believe it from a lot of numerous angles. Its like women and men are not fascinated except it is one thing to accomplish with Woman gaga! Your own stuffs nice. Always handle it up!

  3. Simply want to say your article is as astonishing.
    The clearness in your publish is simply cool and that i can suppose you are an expert on this subject.
    Fine along with your permission allow me to grab your feed to keep up to date with drawing close post.
    Thanks one million and please carry on the rewarding work.

  4. Very great post. I simply stumbled upon your weblog and wished to say that I have truly enjoyed surfing around your weblog posts.
    In any case I will be subscribing to your rss feed and I am hoping you write again soon!

  5. Greetings I am so glad I found your blog page, I
    really found you by error, while I was looking on Digg for something else,
    Anyhow I am here now and would just like to say thanks for a fantastic
    post and a all round interesting blog (I also love the theme/design),
    I don’t have time to browse it all at the minute but I have bookmarked it and also
    added in your RSS feeds, so when I have time I will be back to read a
    lot more, Please do keep up the superb b.

  6. Have you ever considered about including a little
    bit more than just your articles? I mean, what you say is
    important and everything. However just imagine
    if you added some great photos or videos to give your posts more,
    "pop"! Your content is excellent but with images and
    video clips, this blog could definitely be one of the greatest in its niche.
    Very good blog!

  7. I am really impressed with your writing skills and also with the layout on your
    weblog. Is this a paid theme or did you modify it yourself?

    Either way keep up the excellent quality writing, it is rare to see
    a nice blog like this one nowadays.

  8. I have been surfing on-line greater than three hours lately, yet I by no means found any
    interesting article like yours. It is beautiful worth enough for me.
    In my opinion, if all web owners and bloggers made excellent content material as you probably did, the net will likely be much more helpful than ever before.

  9. Nice post. I was checking continuously this weblog and I am impressed!
    Extremely helpful information particularly the ultimate part :) I deal with such info much.
    I was seeking this particular info for a long time. Thanks
    and good luck.

  10. Greetings from Woree, Australia.My name's Therese and I want to ask: do you have a spam issue on this blog? I too am a blogger, and I was wanting to know about your situation. Some of us have developed some effective strategies and we are seeking to trade ideas with other folks. Why not shoot me an e-mail if interested?

  11. I was recommended this blog by my cousin. I am not sure whether this
    post is written by him as nobody else know such detailed about my trouble.

    You are amazing! Thanks!

  12. Oh my goodness! Impressive article dude! Thank you so
    much, However I am going through troubles with your RSS.
    I don't understand the reason why I cannot subscribe to it. Is there anybody having the same RSS problems? Anyone that knows the solution can you kindly respond? Thanx!!

コメントを残す

メールアドレスが公開されることはありません。

リズムファクトリーはホームページの制作会社です。
ホームページ制作に関するご要望・ご相談はこちらからどうぞ。