Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8327277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:03:25+00:00 2026-06-09T01:03:25+00:00

I have a iOS app to load a html string which refer to external

  • 0

I have a iOS app to load a html string which refer to external css file and javascript file in the same directory.

Here is my html file:

<html>
<head>
    <meta name="viewport" content= user-scalable="no", width="device-width" />
    <meta http-equiv="Content-Type" content="text/html"; charset="UTF-8"/> 
    <link rel="stylesheet" type="text/css" href="mystyle.css" />
    <script type="text/javascript" src="myjavascript.js"></script>
</head>

The css file works fine but it seems the js file never loaded. What could be the reason?

By the way I’m using loadHtmlString: BaseUrl method to load my html string.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T01:03:26+00:00Added an answer on June 9, 2026 at 1:03 am

    This question is a bit old, but since it has not been answered, I would like to point out that if you would like your web view to load a javascript file residing in your bundle, the way to do it is:

    [webView loadHTMLString:html
                   baseURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]]];
    

    If you don’t specify the baseURL there is no chance that the javascript file is loaded.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a mobile app that I developed using PhoneGap (and html/css/javascript) and there
I have an iOS app with a UITableView that has flexible width, which allow
Overview I have an iOS app which sends local notifications at specific dates. I
I am confused, I have an iOS app targeted for Iphone The MainWindow.xib file
I have a little problem with memory management in my iOS App. I load
I have an iOS app which gets some JSON from a server (in the
I have an iOS app which use the ffmpeg library, and iOS should compile
I need to load localized images in my iOS app, but also have to
Here is my question : I have an app running smoothly on iOS 3.0
I have an iOS 5 app that uses NSURLConnection to load some XML via

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.