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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:33:41+00:00 2026-05-24T19:33:41+00:00

hi i have a graph created from a .csv file using the jquery $.get().

  • 0

hi i have a graph created from a .csv file using the jquery $.get(). but currently i am passing hardcoded file name as first argument to my get() method. My function is in a file named index.js and is like this

    $(document).ready(function() { 
        $.get('myproject.csv', function(data) { ..... } 
    ....... });

but what i want is to pass a variable which contains the file name so that it can have any file name instead of ‘myproject.csv’

    $.get($filename, function(data) { 

where $filename could be any filename passed. i don’t have much idea about jquery and all so not sure.

Now the main thing is that i have a .phtml file where i have this javascript file incorporated as inline script. So I have no idea how to pass the variable from this .phtml file to this javascript file.
My .phtml file:

      <head>.......</head>
      <body>
      <script type="text/javascript" src="/PFFd02/public/media/js/modules/appone/index/index.js"></script>      // this is where i need to pass my variable. 
      ...........
      </body>

any help???

  • 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-24T19:33:41+00:00Added an answer on May 24, 2026 at 7:33 pm

    Thanks to you all. I figured out a simple way of passing the variable from php file to my js.

    What i did was i created a view variable in my controller file and assigned it a string containing div tag as follows:

        $this->view->filename = "<div id=\"filename\" style=\"display:none\">".$file."</div>";
    

    where $file is the variable that contains my filename which i have to pass to javascript. Now in my zend view i did something like this:

        <?php echo $this->filename ?>
    

    which is making the filename available to my view where i have to run that javascript. Then in my javascript function i initialized a variable like this:

            var file = $('#filename').text();
            $.get(file, function(data) {
    

    and so i got the variable passed from php file to my javascript function.

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

Sidebar

Related Questions

I have some logic whereby a graph of POCO entities need to be cloned
I have a piece of code that filters a list using LINQ, creates a
I have a facebook app page, and a separate facebook business profile page. The
I have a simple ADO.NET Entity Framework 4.0 model (edmx) which defines database tables
I want to publish to the wall of a Facebook Fan Page, from a
I am using a book with a function I would like to use. However
Currently I am loooking for a way to develop an algorithm which is supposed
I'm writing a class in Java to represent a Graph data structure. This is
class TimeObject { DateTime time; bool isMatinee; } Given: {8:00, 9:30, 11:00, 12:10, 2:00,
I am looking for a tool to help in designing and implementing database and

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.