Ask Question Forum:
Model Library:2025-02-08 Updated:A.I. model is online for auto reply question page
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
Asked by duncanb7
at 2024-11-17 11:31:22
Point:500 Replies:9 POST_ID:828429USER_ID:11059
Topic:
JavaScript;;
I try one tutorial example for mootools to just want to extract html data of example.html into div tag, but
it always no response and no javascript error .
Please advise what is mistake ? is it related to library i include
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/mootools/1.3.0/mootools-yui-compressed.js"></script>
that is outdated. Coud you try it at your side ?
DUncan
it always no response and no javascript error .
Please advise what is mistake ? is it related to library i include
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/mootools/1.3.0/mootools-yui-compressed.js"></script>
that is outdated. Coud you try it at your side ?
DUncan
<html><script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/mootools/1.3.0/mootools-yui-compressed.js"></script><script type="text/javascript">function GetMyAJAXFile() { var myHTMLRequest = new Request.HTML({ url:'http://www.mywebsite/example.html', onSuccess: function(responseTree, responseElements, responseHTML, responseJavaScript) { // This will b e triggered after the document is loaded succesfully // $('MyDiv').innerHTML = responseHTML; }}).post();}</script><body><input type='button' onclick='GetMyAJAXFile();' value='click me' /><div id="MyDiv">loading</div></body></html> 1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:16:17:18:19:20:21:22:23:24:25:26:27:28:
Author: duncanb7 replied at 2024-11-18 13:51:52
sorry @Codebot this is linked with another question which is why it could be so confusing
there's no point changing the sales1.htm excel file because you'll overwrite it each time.
THE ISSUE IS THAT INTERNET EXPLORER CACHES AJAX REQUESTS
this is the big problem you are having. to fix it you need to make your "request" unique each time
so using your code from the question i've added the following
data: 'ignoreMe='+new Date().getTime(),
there's no point changing the sales1.htm excel file because you'll overwrite it each time.
THE ISSUE IS THAT INTERNET EXPLORER CACHES AJAX REQUESTS
this is the big problem you are having. to fix it you need to make your "request" unique each time
so using your code from the question i've added the following
data: 'ignoreMe='+new Date().getTime(),
<html><script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/mootools/1.3.0/mootools-yui-compressed.js"></script><script type="text/javascript">function GetMyAJAXFile() { var myHTMLRequest = new Request.HTML({ url:'http://www.mywebsite/example.html', data: 'ignoreMe='+new Date().getTime(), onSuccess: function(responseTree, responseElements, responseHTML, responseJavaScript) { // This will b e triggered after the document is loaded succesfully // $('MyDiv').innerHTML = responseHTML; }}).post();}</script><body><input type='button' onclick='GetMyAJAXFile();' value='click me' /><div id="MyDiv">loading</div></body></html> 1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:16:17:18:19:20:21:22:23:24:25:26:27:28:29:
Assisted Solution
Expert: Rob Jurd replied at 2024-11-18 13:28:58
150 points EXCELLENT
sorry @Codebot this is linked with another question which is why it could be so confusing
there's no point changing the sales1.htm excel file because you'll overwrite it each time.
THE ISSUE IS THAT INTERNET EXPLORER CACHES AJAX REQUESTS
this is the big problem you are having. to fix it you need to make your "request" unique each time
so using your code from the question i've added the following
data: 'ignoreMe='+new Date().getTime(),
there's no point changing the sales1.htm excel file because you'll overwrite it each time.
THE ISSUE IS THAT INTERNET EXPLORER CACHES AJAX REQUESTS
this is the big problem you are having. to fix it you need to make your "request" unique each time
so using your code from the question i've added the following
data: 'ignoreMe='+new Date().getTime(),
<html><script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/mootools/1.3.0/mootools-yui-compressed.js"></script><script type="text/javascript">function GetMyAJAXFile() { var myHTMLRequest = new Request.HTML({ url:'http://www.mywebsite/example.html', data: 'ignoreMe='+new Date().getTime(), onSuccess: function(responseTree, responseElements, responseHTML, responseJavaScript) { // This will b e triggered after the document is loaded succesfully // $('MyDiv').innerHTML = responseHTML; }}).post();}</script><body><input type='button' onclick='GetMyAJAXFile();' value='click me' /><div id="MyDiv">loading</div></body></html> 1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:16:17:18:19:20:21:22:23:24:25:26:27:28:29:
Author: duncanb7 replied at 2024-11-18 10:14:25
coud you say in detail, I can't catch it
Expert: Codebot replied at 2024-11-18 10:06:49
try to change
<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">
First line with my code
<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">
First line with my code
Author: duncanb7 replied at 2024-11-18 09:41:09
Re-sent for typing mistake
Dear CobeBot, it works for your code after I test, but the question
is why when I use other url html file into mysite, It won't response to the
content change of the html file I made . It always displays previous innHTML
content until I go to web other wbesite and come back again and run your code
again in the same IE7 windows OR I quit IE7 and restart your code again in new IE
that the problem will be gone and the innerHTML content is updated according to the change I made in the html file
I try your code in FireFox that is not working at all
Please advise and attach code is replcament for var url = "http://demos111.mootools.net/demos/Ajax/lipsum.html";, it call Sales1.htm, its div
tag is <div id="Book1_25322" align=center x:publishsource="Excel">ABCD</div>
I made "ABCD" change to random character for testing Ajax.
Duncan
Dear CobeBot, it works for your code after I test, but the question
is why when I use other url html file into mysite, It won't response to the
content change of the html file I made . It always displays previous innHTML
content until I go to web other wbesite and come back again and run your code
again in the same IE7 windows OR I quit IE7 and restart your code again in new IE
that the problem will be gone and the innerHTML content is updated according to the change I made in the html file
I try your code in FireFox that is not working at all
Please advise and attach code is replcament for var url = "http://demos111.mootools.net/demos/Ajax/lipsum.html";, it call Sales1.htm, its div
tag is <div id="Book1_25322" align=center x:publishsource="Excel">ABCD</div>
I made "ABCD" change to random character for testing Ajax.
Duncan
<html xmlns:o="urn:schemas-microsoft-com:office:office"xmlns:x="urn:schemas-microsoft-com:office:excel"xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=windows-1252"><meta name=ProgId content=Excel.Sheet><meta name=Generator content="Microsoft Excel 12"><link rel=File-List href="sales1_files/filelist.xml"></head><body><!--[if !excel]> <![endif]--><!--The following information was generated by Microsoft Office Excel's Publishas Web Page wizard.--><!--If the same item is republished from Excel, all information between the DIVtags will be replaced.--><!-----------------------------><!--START OF OUTPUT FROM EXCEL PUBLISH AS WEB PAGE WIZARD --><!-----------------------------><div id="Book1_25322" align=center x:publishsource="Excel">ABCD</div><!--------------------<img src="sales1_files/Book1_25322_image001.gif" alt=Chart1>---------><!--END OF OUTPUT FROM EXCEL PUBLISH AS WEB PAGE WIZARD--><!-----------------------------></body></html> 1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:16:17:18:19:20:21:22:23:24:25:26:27:28:29:30:
Author: duncanb7 replied at 2024-11-18 09:30:25
Dear CobeBot, it works for your code after I test, but the question
is why when I url other html file into mysite, It won't response to the
content change of the html file I made . It always displays previous innHTML
content until I go to web other wbesite and come back again and run your code
again in the same IE7 windows OR I quit IE7 and restart your code again, the innerHTML content is updated according to the change I made in the html file
I try your code in FireFox that is not working at all.
Please advise and attach code is replcament for var url = "http://demos111.mootools.net/demos/Ajax/lipsum.html";, it call Sales1.htm, its div
tag is <div id="Book1_25322" align=center x:publishsource="Excel">ABCD/div>
I made "ABCD" change to random character for testing Ajax.
Duncan
is why when I url other html file into mysite, It won't response to the
content change of the html file I made . It always displays previous innHTML
content until I go to web other wbesite and come back again and run your code
again in the same IE7 windows OR I quit IE7 and restart your code again, the innerHTML content is updated according to the change I made in the html file
I try your code in FireFox that is not working at all.
Please advise and attach code is replcament for var url = "http://demos111.mootools.net/demos/Ajax/lipsum.html";, it call Sales1.htm, its div
tag is <div id="Book1_25322" align=center x:publishsource="Excel">ABCD/div>
I made "ABCD" change to random character for testing Ajax.
Duncan
<html xmlns:o="urn:schemas-microsoft-com:office:office"xmlns:x="urn:schemas-microsoft-com:office:excel"xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=windows-1252"><meta name=ProgId content=Excel.Sheet><meta name=Generator content="Microsoft Excel 12"><link rel=File-List href="sales1_files/filelist.xml"></head><body><!--[if !excel]> <![endif]--><!--The following information was generated by Microsoft Office Excel's Publishas Web Page wizard.--><!--If the same item is republished from Excel, all information between the DIVtags will be replaced.--><!-----------------------------><!--START OF OUTPUT FROM EXCEL PUBLISH AS WEB PAGE WIZARD --><!-----------------------------><div id="Book1_25322" align=center x:publishsource="Excel">ABCD/div><!--------------------<img src="sales1_files/Book1_25322_image001.gif" alt=Chart1>---------><!--END OF OUTPUT FROM EXCEL PUBLISH AS WEB PAGE WIZARD--><!-----------------------------></body></html> 1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:16:17:18:19:20:21:22:23:24:25:26:27:28:29:30:
Expert: Rob Jurd replied at 2024-11-18 03:00:41
Hi Duncan,
you need to remove the http://www.... from the url
it should just be
url: "/example.html"
...
@Codebot: single or double quotes shouldn't be a problem
you need to remove the http://www.... from the url
it should just be
url: "/example.html"
...
@Codebot: single or double quotes shouldn't be a problem
Accepted Solution
Expert: Codebot replied at 2024-11-18 02:59:56
350 points EXCELLENT
or use this when.
I tested this one and working fine
Just change the page name according to your needs.
<html>
<script type="text/javascript" src="http://demos111.mootools.net/demos/mootools.svn.js"></script>
<script type="text/javascript" src="http://demos111.mootools.net/scripts/demos.js"></script>
<script type="text/javascript">
window.addEvent('domready', function(){
$('button1').addEvent('click', function(e) {
e = new Event(e).stop();
var url = "http://demos111.mootools.net/demos/Ajax/lipsum.html";
/**
* The simple way for an Ajax request, use onRequest/onComplete/onFailure
* to do add your own Ajax depended code.
*/
new Ajax(url, {
method: 'get',
update: $('MyDiv')
}).request();
});
});
</script>
<body>
<input type='button' id="button1" onclick='GetMyAJAXFile();' value='click me' />
<div id="MyDiv">loading</div>
</body>
</html>
I tested this one and working fine
Just change the page name according to your needs.
<html>
<script type="text/javascript" src="http://demos111.mootools.net/demos/mootools.svn.js"></script>
<script type="text/javascript" src="http://demos111.mootools.net/scripts/demos.js"></script>
<script type="text/javascript">
window.addEvent('domready', function(){
$('button1').addEvent('click', function(e) {
e = new Event(e).stop();
var url = "http://demos111.mootools.net/demos/Ajax/lipsum.html";
/**
* The simple way for an Ajax request, use onRequest/onComplete/onFailure
* to do add your own Ajax depended code.
*/
new Ajax(url, {
method: 'get',
update: $('MyDiv')
}).request();
});
});
</script>
<body>
<input type='button' id="button1" onclick='GetMyAJAXFile();' value='click me' />
<div id="MyDiv">loading</div>
</body>
</html>
Expert: Codebot replied at 2024-11-18 02:46:23
First manually check page
http://www.mywebsite/example.html
to see if it is giving some results.
then use alert(responseHTML);
before
$('MyDiv').innerHTML = responseHTML;
Also change onclick='GetMyAJAXFile();'
to
onclick="GetMyAJAXFile();"
double quotes
http://www.mywebsite/example.html
to see if it is giving some results.
then use alert(responseHTML);
before
$('MyDiv').innerHTML = responseHTML;
Also change onclick='GetMyAJAXFile();'
to
onclick="GetMyAJAXFile();"
double quotes