if you see my javascript.js i am trying to update my index page, using an xml upload
however I am a very rusty/novice/not even really a programmer but trying hard
and so i cannot see why its not working or how to make it work :(
Sweet Coding :)
@SweetCodingInc
wait..
you want to first upload an xml. And then based on content of that xml you want your index.html to be updated?
Arun Shah
@ameeno
yes
Sweet Coding :)
@SweetCodingInc
well.. The way you're doing it isn't gonna work the way you expect it
Arun Shah
@ameeno
ok
how should i do it?
I saw those ways on youtube
Sweet Coding :)
@SweetCodingInc
if I understood correctly, you have a php server with this end point that accepts xml file upload.php
Arun Shah
@ameeno
yep i'm using xampp
Sweet Coding :)
@SweetCodingInc
to which when the file is submitted, it is placed in a folder called uploads/
Arun Shah
@ameeno
and i want to make yep
Sweet Coding :)
@SweetCodingInc
then you want to read this file, and update you index.html
Arun Shah
@ameeno
the file is called newdData.xml
Yes
Sweet Coding :)
@SweetCodingInc
Alright then you're 50% on track
so you first need to separate out file upload logic from file retrieval logic
Arun Shah
@ameeno
presently, i am trying to simply update an unordered list
could i run the javascript at the end of the upload.php file?
i have tried new window the upload.php and then close window
Sweet Coding :)
@SweetCodingInc
That's the problem, right? How do you know the end of upload has reached?
_
Arun Shah
@ameeno
and i have tried to add a delay in the javascript but i do not know how
Stephen James
@sjames1958gm
@abhinav-m :+1: Well done - some suggestions
make the fog of war a little larger and blocked by walls
allow the remembering of rooms
bad guys don't move.
Arun Shah
@ameeno
my file is small, i'm just going to hard code a delay of 3000-5000 ms
Sweet Coding :)
@SweetCodingInc
because you have <form target="_blank" action="upload.php" method="post" when you submit the form, the page will refresh and you will lose all the progress
is your upload.php end point behaving correctly?
Arun Shah
@ameeno
i thought if i tell the php to go back to previous page we break the js
yes the upload php works beutifully
i have even tried renaming various files, the upload works well
Sweet Coding :)
@SweetCodingInc
sweet.. then I'll show you a way to fix this
first give an id to your form and remove that action="upload.php" attribute
Arun Shah
@ameeno
problem has been the WHOLE time this AJAX, Actually sweetcoding, i was having problems with the Ajax for over 2 days, And i simply introduced the upload feature today. but even with manual reading and a file previously present
it WILL NOT UPDATE my html
ok
Sweet Coding :)
@SweetCodingInc
I see...
so let's fix that problem first...
Arun Shah
@ameeno
I am happy to marry together and work on the upload after the page is actually updating (file already in folder)
but right goping to name the form with id.
Sweet Coding :)
@SweetCodingInc
give me a min
Arun Shah
@ameeno
I am trying to update the text in a LI because really what i want to do is update <img tags> but i am trying to do it incrementally,
Sweet Coding :)
@SweetCodingInc
I see
I checked your code
the ajax is working correctly
however, this part is not working correctly $(data).find('programme Data').each(function() {
Arun Shah
@ameeno
ok
would it help if i showed you a pastebin of my xml?