Ajax script stopped working.

M

Mechphisto

I couldn't find an Ajax group to ask this in -- this is the closest
related group I could find. If someone could point me to one, I'd
appreciate it. (If there's anyone except spammers using this group.
Sheesh!)

I've a Web page I put together which uses javascript and Google API
Ajax to return to the page a display of files the user uploads. It
used to work great, and then today I noticed it's no longer working.
Could something have changed with the .js files it's linking to?

It's at http://www.girlscoutsmoheartland.org/photos/upload/imageupload.php
The files still upload to the server just fine, but it's no longer
displaying onto the page the result of the browse...upload.

I Googled for the files, but as far as I can tell I'm linking to the
latest ones:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/
jquery.min.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/
jquery-ui.min.js" type="text/javascript"></script>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/
jqueryui/1.7.2/themes/ui-darkness/jquery-ui.css" type="text/css"
media="all" />

so, maybe that's not the issue...but the fact it worked great, no one
on this end touched it, and now it doesn't work, leads me to think
it's something on the linked .js end.

I appreciate any help or suggestions!
Liam
 
S

Scott Sauyet

I've a Web page I put together which uses javascript and Google API
Ajax to return to the page a display of files the user uploads. It
used to work great, and then today I noticed it's no longer working.
Could something have changed with the .js files it's linking to?

It's athttp://www.girlscoutsmoheartland.org/photos/upload/imageupload.php
The files still upload to the server just fine, but it's no longer
displaying onto the page the result of the browse...upload.

This might be better asked in the jQuery group if you're using a
jQuery function. (I didn't look closely enough to know if you are
using jQuery for your uploads at all, so this may not be relevant.)

I noticed that you include jQuery twice, once a packed version of
1.0.4 from your server, and a minified version of 1.3.2 from Google's
CDN. It might help to get rid of one.
 
G

Garrett Smith

I couldn't find an Ajax group to ask this in -- this is the closest
related group I could find. If someone could point me to one, I'd
appreciate it. (If there's anyone except spammers using this group.
Sheesh!)

I've a Web page I put together which uses javascript and Google API
Ajax to return to the page a display of files the user uploads. It
used to work great, and then today I noticed it's no longer working.
Could something have changed with the .js files it's linking to?

Yes.

It's at http://www.girlscoutsmoheartland.org/photos/upload/imageupload.php
The files still upload to the server just fine, but it's no longer
displaying onto the page the result of the browse...upload.

I Googled for the files, but as far as I can tell I'm linking to the
latest ones:
At jQuery.com, I see the text "Current release: 1.4.2".

A google search for [jquery googleapies],
<http://www.google.com/search?q=jquery+googleapis> has in the results
page <http://code.google.com/apis/ajaxlibs/> which contains the linked
text "jquery" leading to
<http://code.google.com/apis/ajaxlibs/documentation/index.html#jquery>,
which has:

| name: jquery
| versions: 1.2.3, 1.2.6, 1.3.0, 1.3.1, 1.3.2, 1.4.0, 1.4.1, 1.4.2
| ...
| path: http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js
| path(u): http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js

- and -

| name: jqueryui
| versions: 1.5.2, 1.5.3, 1.6, 1.7.0, 1.7.1, 1.7.2, 1.7.3, 1.8.0,
| 1.8.1, 1.8.2
| path: http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.min.js
| path(u): http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.js

Compare that to your code:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/
jquery.min.js" type="text/javascript"></script>

What you have there is not the latest version.
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/
jquery-ui.min.js" type="text/javascript"></script>

Nor is that the latest verson of jQuery UI. Whether or not those two
things are compatible is another matter and unknown to me.
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/
jqueryui/1.7.2/themes/ui-darkness/jquery-ui.css" type="text/css"
media="all" />

so, maybe that's not the issue...but the fact it worked great, no one
on this end touched it, and now it doesn't work, leads me to think
it's something on the linked .js end.

It could be, but then again, it does not appear that you've looked into
the issue.
I appreciate any help or suggestions!

Your post reads along the lines:
I used jQuery.
It was working.
Now it doesn't work.
Why doesn't it work anymore?

While it is not possible to give a specific answer, I can verify that
this sort of post is not new to the NG and you will likely get other
replies that verify that.

So what do you do now? You can compare what you want to do with what you
are doing. You could read:
<http://jibbering.com/faq/notes/posting/#ps1DontWork>, which might help
you think about the problem and after you do that, you can break up the
problem into smaller problems that can be posed as specific questions
which can be answered in a technical manner.

If the program was not fulfilling the user stories and use cases well,
then it may be best to redo it.
 
M

Mechphisto

This might be better asked in the jQuery group if you're using a
jQuery function.  (I didn't look closely enough to know if you are
using jQuery for your uploads at all, so this may not be relevant.)

I noticed that you include jQuery twice, once a packed version of
1.0.4 from your server, and a minified version of 1.3.2 from Google's
CDN.  It might help to get rid of one.

Thanks for the reply. Are you referring to the line:
<script type="text/javascript" src="../../includes/jquery.js"></
script> ?
If so, that actually points to a check that alerts the user if they
don't have javascript enabled, they need to or the page won't work.
But, just to see if that is causing an issue, I tried again without
that line, and same thing.
Thanks again,
Liam
 
M

Mechphisto

I couldn't find an Ajax group to ask this in -- this is the closest
related group I could find. If someone could point me to one, I'd
appreciate it. (If there's anyone except spammers using this group.
Sheesh!)
I've a Web page I put together which uses javascript and Google API
Ajax to return to the page a display of files the user uploads. It
used to work great, and then today I noticed it's no longer working.
Could something have changed with the .js files it's linking to?
Yes.

It's athttp://www.girlscoutsmoheartland.org/photos/upload/imageupload.php
The files still upload to the server just fine, but it's no longer
displaying onto the page the result of the browse...upload.
I Googled for the files, but as far as I can tell I'm linking to the
latest ones:

At jQuery.com, I see the text "Current release: 1.4.2".

A google search for [jquery googleapies],
<http://www.google.com/search?q=jquery+googleapis> has in the results
page <http://code.google.com/apis/ajaxlibs/> which contains the linked
text "jquery" leading to
<http://code.google.com/apis/ajaxlibs/documentation/index.html#jquery>,
which has:

| name: jquery
| versions: 1.2.3, 1.2.6, 1.3.0, 1.3.1, 1.3.2, 1.4.0, 1.4.1, 1.4.2
| ...
| path:http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js
| path(u):http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js

- and -

| name: jqueryui
| versions: 1.5.2, 1.5.3, 1.6, 1.7.0, 1.7.1, 1.7.2, 1.7.3, 1.8.0,
| 1.8.1, 1.8.2
| path:http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.min.js
| path(u):http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.js

Compare that to your code:
     <script src="http://ajax.googleapis.com/ajax/libs/jquery/1..3.2/
jquery.min.js" type="text/javascript"></script>

What you have there is not the latest version.
     <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/
jquery-ui.min.js" type="text/javascript"></script>

Nor is that the latest verson of jQuery UI. Whether or not those two
things are compatible is another matter and unknown to me.
     <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/
jqueryui/1.7.2/themes/ui-darkness/jquery-ui.css" type="text/css"
media="all" />
so, maybe that's not the issue...but the fact it worked great, no one
on this end touched it, and now it doesn't work, leads me to think
it's something on the linked .js end.

It could be, but then again, it does not appear that you've looked into
the issue.
I appreciate any help or suggestions!

Your post reads along the lines:
I used jQuery.
It was working.
Now it doesn't work.
Why doesn't it work anymore?

While it is not possible to give a specific answer, I can verify that
this sort of post is not new to the NG and you will likely get other
replies that verify that.

So what do you do now? You can compare what you want to do with what you
are doing. You could read:
<http://jibbering.com/faq/notes/posting/#ps1DontWork>, which might help
you think about the problem and after you do that, you can break up the
problem into smaller problems that can be posed as specific questions
which can be answered in a technical manner.

If the program was not fulfilling the user stories and use cases well,
then it may be best to redo it.

Well, that's embarrassing. I assure you, the first thing I did was
check to see if there were different versions. My search path, I don't
recall. My failure is not that I didn't investigate, but that I
investigated poorly and found erroneous info regarding latest
versions.

(I changed the links to the latest version numbers, and that didn't
help.)

I understand the necessity of parsing "it didn't work" with
expectations. The problem here is that it's not a problem of not
getting something to work that never worked before, but rather one of
it used to work just fine, then suddenly it stopped. If nothing
changed on my end, logic dictates the problem is on the end of
wherever I'm linking a file from.
(Or, maybe a change at my server's host. I suppose that's possible,
but when dealing with javascript/Ajax... client-side behavior, I'm not
sure how that would be.)

If I need to start over (oh god!!) then I suppose I have to. But I'm
sure you can understand my position in which I spent days making this
work in the first place, it works great and all is happy, then through
no action on my part it stops working -- why I want to start by
pursuing options that may be quick fixes before I start redoing
things.

In my experience, there have been many times I've presented more
experienced and knowledgeable people why a problem, and someone says
something like, "ah, you simply have a foo where a bar should be," and
bang! it's fixed. I'm not going to pass up the possibility that
something like that may not happen here. (E.g.: someone pointing out
I'm linking to the wrong version number because my Google-fu is sucky.
Didn't work in this case, but if it had, I'm going to take the
opportunity to have that chance.)
Thanks,
Liam
 
M

Mechphisto

Mechphisto said:
[snip ca. 92+ lines of full quote]
Well, that's embarrassing. [...]

Embarrassing for you and annoying for your readers is the way that you post.

Aww, how precious! You're being clever. :)
*golf clap*

I already self-deprecated in admitting I was embarrassed at my
blunder, and that I failed in my search, and that I may have to re-do
my work. Don't you have something more productive to do than spew
pedantry?
Ah khrahp! I just got trolled.
 
G

Garrett Smith

Mechphisto said:
[snip ca. 92+ lines of full quote]
Well, that's embarrassing. [...]

Embarrassing for you and annoying for your readers is the way that you post.

Aww, how precious! You're being clever. :)

I wouldn't call it clever. He pointed out that you replied by
fullquoting and made a snide remark in the process and provided a URL to
the section of the FAQ on posting. Snide remarks aside, reading that and
following the posting guidelines could have made your post more readable.
 
G

Garrett Smith

Mechphisto wrote:
[snip ca. 92+ lines of full quote]

Well, that's embarrassing. [...]

Embarrassing for you and annoying for your readers is the way that
you post.

Aww, how precious! You're being clever. :)

I wouldn't call it clever. He pointed out that you replied by
fullquoting and made a snide remark in the process and provided a URL to
the section of the FAQ on posting. Snide remarks aside, reading that and
following the posting guidelines could have made your post more readable.

Ah, that was ambiguous. I meant to say that he (TL) pointed out that you
replied by fullquoting. He also made a snide remark...
 
S

Scott Sauyet

Mechphisto said:
Thanks for the reply. Are you referring to the line:
<script type="text/javascript" src="../../includes/jquery.js"></
script> ?
If so, that actually points to a check that alerts the user if they
don't have javascript enabled, they need to or the page won't work.

It doesn't look like such. It looks like an old packed version of
JQuery.

Moreover, how would you alert the user that JS is not enabled by using
JS?!
But, just to see if that is causing an issue, I tried again without
that line, and same thing.

I'd have to know more of the expected behavior to have any sense of
what's wrong.

Have you tested in a debugger? Firebug is pretty helpful.

-- Scott
 
T

Thomas 'PointedEars' Lahn

Garrett said:
Garrett said:
Mechphisto said:
Thomas 'PointedEars' Lahn wrote:
Mechphisto wrote:
[snip ca. 92+ lines of full quote]

Well, that's embarrassing. [...]
Embarrassing for you and annoying for your readers is the way that
you post.
[...]
Ah, that was ambiguous. I meant to say that he (TL) pointed out that you
replied by fullquoting. He also made a snide remark...

What you call a snide remark, I call a correction accompanied with a
descriptive distinct warning. Not that either way the message got through.
But, unfortunately, that is not surprising with a Googlodyte.


PointedEars
 
M

Mechphisto

It doesn't look like such.  It looks like an old packed version of
JQuery.

Moreover, how would you alert the user that JS is not enabled by using
JS?!

Hmm, honestly, I have no idea how it works. As I understand, if that
script loads and it detects that the browser isn't allowing javascript
to run, then it allows the div ID: <div id="noScript"> to be visible.
Display:none if javascript works. Within that div I have a message
that informs the user the page won't work without javascript enabled.
I'd have to know more of the expected behavior to have any sense of
what's wrong.

Of course. (I was hoping the problem would be obvious to someone more
skilled than I and it wouldn't have to go this far.) :)
On that page, down there by the line: "Uploaded files:" I have this:

<p><strong>Uploaded files</strong>:</p>
<p class="text" style="color: #9898FF; font-weight:bold;"></p>
<p class="textC" style="color: #1EEF1E;"></p>
<p class="textE" style="color: #E86868;"></p>
<ol class="files">
</ol>


Now, this bit of javascript:

new AjaxUpload('button3', {
action: 'server-side/upload-handler.php',
//name: 'myfile',
onSubmit : function(file , ext){
// Allow only images. You should add security check on
the server-side.
if (ext && /^(jpg|png|jpeg|gif)$/.test(ext)){
/* Setting data */
this.setData({
'key': 'This string will be send with the file'
});
$('#example3 .text').text('Uploading ' + file + '... Please
wait....');
$('#example3 .textC').text('');
$('#example3 .textE').text('');
} else {
// extension is not allowed
$('#example3 .textE').text('Error: only images are allowed');
// cancel upload
return false;
}
},
onComplete : function(file){
$('<li></li>').appendTo($('#example3 .files')).text(file);
$('#example3 .text').text('');
$('#example3 .textC').text(file + ' Uploaded!');
}
});

will populate those <p> lines with different messages based on what is
detected with the file browse. If someone tries to select a non-image
file, a message "Error: only images are allowed" appears. Otherwise an
"Uploading Please wait" message appears. And then when the file is
uploaded, the name of the file appears...along with any subsequent
files into a list.

The files are uploading fine without refreshing the page. In fact,
it's even refusing the non-image files as well. So I know this script
is working at the basic level. It's simply not changing the HTML to
display those status message any more.
Very frustrating to have something work then not work and no idea
why. :(
Have you tested in a debugger?  Firebug is pretty helpful.

Well, I used the error console. The only errors it's giving me are
errors like:
Warning: Error in parsing value for 'filter'. Declaration dropped.
Source File: http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/ui-darkness/jquery-ui.css
Line: 18

I've tried removing the http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/ui-darkness/jquery-ui.css
line from the code, but that got rid of the errors yet the problem
remained.
I don't know what firebug tool would help with diagnosing this...any
ideas?

Thanks for replying! I really appreciate it.
Liam
 
M

Mechphisto

Of course. (I was hoping the problem would be obvious to someone more
skilled than I and it wouldn't have to go this far.) :)
On that page, down there by the line: "Uploaded files:" I have this:

      <p><strong>Uploaded files</strong>:</p>
      <p class="text" style="color: #9898FF; font-weight:bold;"></p>
      <p class="textC" style="color: #1EEF1E;"></p>
      <p class="textE" style="color: #E86868;"></p>
                <ol class="files">
            </ol>

Now, this bit of javascript:

                new AjaxUpload('button3', {
                        action: 'server-side/upload-handler.php',
                        //name: 'myfile',
                        onSubmit : function(file , ext){
                // Allow only images. You should add security check on
the server-side.
                                if (ext && /^(jpg|png|jpeg|gif)$/.test(ext)){
                                        /* Setting data */
                                        this.setData({
                                                'key': 'This string will be send with the file'
                                        });
                                        $('#example3 .text').text('Uploading ' + file + '... Please
wait....');
                                        $('#example3 .textC').text('');
                                        $('#example3 .textE').text('');
                                } else {
                                        // extension is not allowed
                                        $('#example3 .textE').text('Error: only images are allowed');
                                        // cancel upload
                                        return false;
                                }
                        },
                        onComplete : function(file){
                                $('<li></li>').appendTo($('#example3 .files')).text(file);
                                        $('#example3 .text').text('');
                                $('#example3 .textC').text(file + ' Uploaded!');
                        }
                });

will populate those <p> lines with different messages based on what is
detected with the file browse. If someone tries to select a non-image
file, a message "Error: only images are allowed" appears. Otherwise an
"Uploading Please wait" message appears. And then when the file is
uploaded, the name of the file appears...along with any subsequent
files into a list.

The files are uploading fine without refreshing the page. In fact,
it's even refusing the non-image files as well. So I know this script
is working at the basic level. It's simply not changing the HTML to
display those status message any more.
Very frustrating to have something work then not work and no idea
why. :(

Holy...
OK, playing around, just trying different things, I took out the
#example. from all the javascript lines. They didn't seem to make
sense being there as they weren't matching the <p> tags that way. And,
now it works again!
Very perplexing! When I put this page together weeks ago and it
worked, that would mean I would have had to have done the same thing
then. It makes no sense as to how it could have possibly reverted
back. Especially since that page had a LOT of changes made to it AFTER
that core functionality was completed weeks ago, and all THOSE changes
are still intact. So it's not a matter of somehow an older copy of the
page getting reuploaded... that script section itself would have had
to have been intentionally restored to an earlier version with the
rest of the page untouched.
It makes no sense to me at all.

Thanks for replying and trying; sorry to have wasted your time.
Liam
 
M

Mechphisto

Garrett said:
Garrett said:
Mechphisto wrote:
Thomas 'PointedEars' Lahn wrote:
Mechphisto wrote:
[snip ca. 92+ lines of full quote]
Well, that's embarrassing. [...]
Embarrassing for you and annoying for your readers is the way that
you post.
[...]
Ah, that was ambiguous. I meant to say that he (TL) pointed out that you
replied by fullquoting. He also made a snide remark...

What you call a snide remark, I call a correction accompanied with a
descriptive distinct warning.  Not that either way the message got through.
But, unfortunately, that is not surprising with a Googlodyte.

What amuses me is how much wasted space, time, and electrons have been
spent on this sub-thread just so you can prove your elitist status as
online communications intelligentsia. Biggest protocol cop on the
block since FIDO, eh? I really am amused how this thread branch is
longer than the one that's actually on-topic. Man, I bet if I top-
replied, I could get you to waste half your day making snide, smug
remarks.
Drat! Now you have me wasting MY time pointing out YOUR wasted time.
It's a recursive time-sink.
Enjoy your ivory tower. :)
 
S

Scott Sauyet

Mechphisto said:
Scott said:
Have you tested in a debugger?  Firebug is pretty helpful.

Well, I used the error console. [ ... ]
I don't know what firebug tool would help with diagnosing this...any
ideas?

Firebug has a reasonably good debugger in it. You can load the script
in question, and set a breakpoint, then step through the code from
there. I'm not in general a fan of debuggers, but sometimes they are
far and away the easiest means to find a problem.
Thanks for replying! I really appreciate it.

I'm glad you solved your problem. Good luck,
 
G

Garrett Smith

Garrett said:
Garrett Smith wrote:
Mechphisto wrote:
Thomas 'PointedEars' Lahn wrote:
Mechphisto wrote:
[snip ca. 92+ lines of full quote]
Well, that's embarrassing. [...]
Embarrassing for you and annoying for your readers is the way that
you post.
[...]
Ah, that was ambiguous. I meant to say that he (TL) pointed out that you
replied by fullquoting. He also made a snide remark...

What you call a snide remark, I call a correction accompanied with a
descriptive distinct warning. Not that either way the message got through.
But, unfortunately, that is not surprising with a Googlodyte.

What amuses me is how much wasted space, time,

In contrast, I would have been more interested in helping you try and
figure out the problem and if you look at the reply you might see that
was my intention.

BTW I don't see TL as being an ivory tower.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top