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 6255053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T14:17:37+00:00 2026-05-24T14:17:37+00:00

I want to load a JavaScript file using Jint, but I can’t seem to

  • 0

I want to load a JavaScript file using Jint, but I can’t seem to figure it out. The documentation said I could do something like engine.run(file1), but it doesn’t appear to be loading any files. Do I need to do something special with the file name?

Here’s my JavaScript file:

// test.js
status = "test";

Here’s my C#

JintEngine js = new JintEngine();
js.Run("test.js");
object result = js.Run("return status;");
Console.WriteLine(result);
Console.ReadKey();

If I put in code manually in Run it works.

object result = js.Run("return 2 * 21;"); // prints 42
  • 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-05-24T14:17:39+00:00Added an answer on May 24, 2026 at 2:17 pm

    I found a workaround by manually loading the file into text myself, instead of loading it by name as mentioned here: http://jint.codeplex.com/discussions/265939

            StreamReader streamReader = new StreamReader("test.js");
            string script = streamReader.ReadToEnd();
            streamReader.Close();
    
            JintEngine js = new JintEngine();
    
            js.Run(script);
            object result = js.Run("return status;");
            Console.WriteLine(result);
            Console.ReadKey();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to load some images into my application from the file system. There's
I have a very large javascript file I would like to load only if
I want to load the lightbox javascript only when a certain condition is satisfied
I have a JavaScript file that embeds a widget on a website. I want
I'm using a fairly simple system to load javascript dynamically: include = function (url)
I want to load a JSON file from my own server containing an array
I want to chain methods in Javascript (using Node.js). However, I encountered this error:
I'm using Google Maps v3 and want it to load faster. My setup: At
Here is what i want to do. Normally we can call javascript functions on
I want to load a html page from a file, and append a hash

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.