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

  • Home
  • SEARCH
  • 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 6850981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:11:29+00:00 2026-05-27T01:11:29+00:00

I am using JavaScript Lint in vim. Recently I converted my pure JavaScript to

  • 0

I am using JavaScript Lint in vim. Recently I converted my pure JavaScript to php so as to make certain server side additions. I have set the file type in vim as such :s filetype=javascript.php.

test.php:

/*jsl:ignore*/
<?php
  header("Content-type: application/x-javascript");
?>
/*jsl:end*/

function foo() {...}

I get a syntax error at <?php, both in vim and online. I guess jsl:ignore ignores warnings, but not syntax errors, and it is detecting <?php as a syntax error. Is there anyway to bypass this as it is essentially a deal breaker for JavaScript Lint.


EDIT There have been a great number of requests as to what it is I am doing, therefore, here is a more thorough explanation.

I have a database for my pictures, like so

ID owner path
0  0     /var/www/0/*.jpg
1  0     /var/www/0/*.jpg
2  1     /var/www/1/*.jpg
3  2     /var/www/2/*.jpg
4  0     /var/www/0/*.jpg

The important thing here is that there is absolutely no correlation between the picture ID and/or who owns the picture and/or where the picture is stored. The client must query the database to find out where the files are stored (the reason for this is that user pictures are added in arbitrary order, and they are often moved around). Lets say there are 1000 pictures, and I want to load them all into the browser (tiny thumbnails).

I could load up index.html then use Ajax to get all 1000 file locations and set populate the browser with images somewhat like so

for (var i = ; i < picturePaths.length ;i++){
    var img = new Image();
    img.src = picturePaths[i];
}

But I don’t want to use Ajax because it is very slow (3/4s) to kick in and retrieve any queries. Instead I want all the img.src attributes to already be set when the page loads.

Now John Watson mentioned below that I could/should return all of these in a single variable and reference that. I am not an expert so he could be right. However, My website is very complex, and different scripts are being dynamically loaded from the server quite frequently, I would prefer not to store important image path’s in a single global object.

  • 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-27T01:11:29+00:00Added an answer on May 27, 2026 at 1:11 am

    My solution for this issue would be to separate my PHP and JavaScript where possible.

    Let your PHP output whatever it needs to output into your HTML and then pick it up from your JavaScript if you want to use it. I can give you more concrete examples of this if you show us what you’re doing.

    Dynamically spitting out a JavaScript file can be problematic as it will be cached on the browser, so the second and subsequent requests may not come back to the server to get a re-evaluated script file.

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

Sidebar

Related Questions

Using Javascript, I have two arrays called array1 and array2. I set currentArrray to
Without using Javascript, is there a way to make a CSS property toggle on
Im using JavaScript, the HTML5 canvas-element and WebGL to make a simple 3D-game in
using javascript google-maps api I currently have it setup to remove a maker I
Using javascript, I have a file in string (got with ajax request). How to
Using JavaScript what’s the simplest way to set a headers id from it’s content
Followed directions in Using JSLint in Notepad++ . Using JavaScript Lint (not JSLint). I
Using JavaScript, HTML and CSS, the server is Java. What is the good develeopment
Using javascript/jQuery: I have an array with images and I need to display them
Im using javascript to include some content served up from a php file on

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.