| Coding Forum Problems with your code? Let's hear about it. |
10-21-2003, 04:06 PM
|
#21 (permalink)
|
|
Inactive
Join Date: 10-12-03
Location: Cranberry Township
Posts: 275
|
Quote:
|
Originally Posted by PhilC
Dunno if this will give you the info you require. It's a whole page that you can upload and load into a browser - it gives you a load of info about the PHP configuration on the server.
|
Sure it does, its the first variable displayed as well as the type of server that you are on.
|
|
|
10-21-2003, 04:14 PM
|
#22 (permalink)
|
|
Crap Bag
Join Date: 10-12-03
Posts: 1,727
Latest Blog: None
|
Quote:
|
Originally Posted by Culland
Well I tested and it works, which is likely because writing the DIV causes a server query. See my code above, where I implimented the idea.
|
It doesn't cause a server query. This is the page in the browser:-
[code:1:351b2fd9a9]<html>
<head>
<script language="javascript">
function dostuff(){
x = document.getElementById("mainblock");
x.innerHTML = "Testing Two";
}
</script>
</head>
<body>
<div id="mainblock">
Testing One
</div>
<br><br>
<input type="button" onClick="dostuff()" value="Push">
</body>
</html>
[/code:1:351b2fd9a9]
Clicking the button merely writes a different phrase into the div. It doesn't go anywhere near the server.
|
|
|
10-21-2003, 04:14 PM
|
#23 (permalink)
|
|
Inactive
Join Date: 10-20-03
Posts: 21
Latest Blog: None
|
I stand corrected, its not working as intended, just works in my short quicky test because its running the function and writing the results, instead of holding the function and inserting it. So in short its processed the result before it sent the page.
Cul
|
|
|
10-21-2003, 04:15 PM
|
#24 (permalink)
|
|
Inactive
Join Date: 10-20-03
Posts: 21
Latest Blog: None
|
Beat me too it 
|
|
|
10-21-2003, 04:20 PM
|
#25 (permalink)
|
|
Crap Bag
Join Date: 10-12-03
Posts: 1,727
Latest Blog: None
|
Quote:
|
Originally Posted by niceguyeddie
Sure it does, its the first variable displayed as well as the type of server that you are on.
|
hehe...I didn't noticed that at the top 
|
|
|
10-21-2003, 04:21 PM
|
#26 (permalink)
|
|
Crap Bag
Join Date: 10-12-03
Posts: 1,727
Latest Blog: None
|
Quote:
|
Originally Posted by Culland
Beat me too it 
|
Yeah - we got our posts the wrong way round 
|
|
|
10-22-2003, 07:25 AM
|
#27 (permalink)
|
|
Moderator
Join Date: 10-13-03
Location: UK
Posts: 2,819
Latest Blog: None
|
Quote:
|
Originally Posted by Culland
Quote:
|
Originally Posted by LazyJim
The point is the user is always in the same page, same HTML document, the content of that page changes only.
|
This I get and understand, but there is only two ways (not counting user input) to change the content of the page, either its written into the page to start with, ie front loading all the text/html into something like a javascript array, or you are fetching new data from the server via includes, php, etc. You can keep the same HTML page, put everything that changes inside a DIV block that you re-write via innerHTML, but it doesnt get around the fact that you either already have the data client side, or you need to request it from the server.
There is a way to alter the XSL file, thus changing what XML data is displayed to the user, completely with javascript. However it only works in IE, plus it doesnt get around the fact that you need to send all the data via XML, which is the same problem as front loading via javascript. You can do server side XSL transformation, but again this calls for a server query, which basically re-writes your HTML page to a new one.
Guess I am out of ideas.
Cul
|
I see you understand now.
I should have been clearer from the start and focused one one thing at a time.
Anyway, so were all on the same wavelength now and we'ev established that any PHP in any web page doesn't even reach the client.
PPK's site is working again (or my connection to it ha started working again), so I can show you the function I found.
http://www.xs4all.nl/~ppk/js/importxml.html
PPK's Import XML function is all well and good, but limited x-browser, and probably only works for XML documents (very useful when I start working with XML, but not yet).
Maybe I could get it working if the files where XHTML, but i'd rather have the ability to make it work with plain old un-marked-up text as well.
Any ideas?
|
|
|
10-22-2003, 10:02 AM
|
#28 (permalink)
|
|
Inactive
Join Date: 10-20-03
Posts: 21
Latest Blog: None
|
This script is only going to work if you are browsing with windows. If you are hosting your website on a windows platform you can interface with the same com object through PHP, I have done this and it was buggy as all heck, so I switched to ASP and it worked fine. A similiar option would be to use the filehandler com object via javascript to open files and read their outputs. However soon as you move to server side like ASP or PHP I think you run into the fact that you have to load all the data at once because the server does it all before sending it to the client.
The alternative is to use PHP, I expect this can be done with just the XMLDOM module active and not need Sablotron, but I could be wrong on that part, but again its server side so you have to front load everything.
In short I think what you might have to do, is allow the client side version for those that can handle it and go iframes/frames or front load the data if they are not windows users.
Cul
|
|
|
10-22-2003, 11:02 AM
|
#29 (permalink)
|
|
Moderator
Join Date: 10-13-03
Location: UK
Posts: 2,819
Latest Blog: None
|
That's a shame 
|
|
|
03-13-2006, 05:34 AM
|
#30 (permalink)
|
|
Moderator
Join Date: 10-13-03
Location: UK
Posts: 2,819
Latest Blog: None
|
Just thought I'd point out that AJAX is now what people use because it there is much better cross-browser support these days.
|
|
|
03-13-2006, 07:11 AM
|
#31 (permalink)
|
|
Inactive
Join Date: 03-02-06
Location: Indianapolis, Indiana
Posts: 142
|
Quote:
|
Originally Posted by LazyJim
Yeah I was rather unclear, and asked lot's of questions at the same time! sorry too
The effect I was trying to create has also been brought up on another thread: "Div Include" http://www.internet-marketing-resear...opic.php?t=523
In essence, I want to load data from html files into the page without the browser going to the page.
The same page has to stay in the browser over the whole session, and I want to download and insert data as it is needed.
*edit - Yes I can already do the insertion bit, I need the download bit.
|
What you are talking about can be done via Ajax (Asyncronous Javascript and Xml). You essentially rely on Javascript's XmlHttpRequest object to retrieve xml data (in real time) from another website or webpage, and then manipulate the DOM of the current page to write to the browser in the exact location you want. The browser window does not need to be refreshed.
There are several good Ajax libraries out there, here are a couple: Moo FX, script.aculo.us/. Or if you aren't a coder and would rather have someone else help you out, pm me.
|
|
|
03-16-2006, 03:09 AM
|
#32 (permalink)
|
|
Moderator
Join Date: 10-13-03
Location: UK
Posts: 2,819
Latest Blog: None
|
Yeah, thanks for the links.
How come everyone had trouble getting it back then when I was first talking about it? Should I have invented a catchy name like AJAX? Was it just too early for everyone else? Was browser support too low? I don't know but I'm glad everyone likes the idea now (even if some people are using it with bad results).
|
|
|
03-17-2006, 07:23 AM
|
#33 (permalink)
|
|
Inactive
Join Date: 03-02-06
Location: Indianapolis, Indiana
Posts: 142
|
You know, I didn't even look at the dates of the post... You definately should have invented a catchy name for it.
|
|
|
03-17-2006, 08:03 AM
|
#34 (permalink)
|
|
Contributing Member
Join Date: 02-20-06
Location: United States
Posts: 351
|
LazyJim invented AJAX...
spread that around. 
|
|
|
03-17-2006, 09:50 AM
|
#35 (permalink)
|
|
Contributing Member
Join Date: 07-30-05
Posts: 282
Latest Blog: None
|
Quote:
|
XMLHttpRequest must have been one of the Web's best kept secrets. Since its debut in 1998, few sites have used it at all, and most developers, if they even knew about it, never used it.
|
link...
|
|
|
06-06-2006, 02:58 PM
|
#36 (permalink)
|
|
Moderator
Join Date: 10-13-03
Location: UK
Posts: 2,819
Latest Blog: None
|
Damn right!
I used in before i started this thread and was frustrated by the IE-only thing, but mozilla might have actually had what I needed at that time anyway. Unfortunatly no-one on this forum was able to show it me!
Edit: no-one even understood what I was talking about let alone tell me there might be a similar function on another browser.
P.S. although don't forget AJAX was possible ever since IFRAMEs worked - and not just using an internal frame, but hiding it and accessing its content via JavaScript.
Last edited by LazyJim : 06-06-2006 at 03:02 PM.
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 10:04 AM.
© Copyright 2008 V7 Inc
|