SearchSearch   

AJAX vs PHP includes

 
Goto page 1, 2
   Webmaster Forums (Home) -> Macromedia Dreamweaver RSS
Next:  Swap Image in two places?  
Author Message
R.J.

External


Since: Apr 05, 2007
Posts: 38



(Msg. 1) Posted: Thu Apr 05, 2007 12:50 pm
Post subject: AJAX vs PHP includes
Archived from groups: macromedia>dreamweaver (more info?)

Could someone tell me the difference (advantages/drawbacks) of using PHP
includes vs AJAX to assemble web pages that recycle many of the same
elements?

Example :
http://www.dhtmlgoodies.com/scripts/ajax-dynamic-content/ajax-dynamic-...tent.ht

Is it the ability to never have to change webpages once you're on the site?
Back to top
dan mode ->Adobe Communit

External


Since: Sep 26, 2006
Posts: 58



(Msg. 2) Posted: Thu Apr 05, 2007 12:50 pm
Post subject: Re: AJAX vs PHP includes
Archived from groups: per prev. post (more info?)

> Is it the ability to never have to change webpages once you're on the
> site?


If by "change" you mean "reload" or pass variables to another page, then
yes.


--

Dan Mode
--> Adobe Community Expert
*Flash Helps* http://www.smithmediafusion.com/blog/?cat=11
*THE online Radio* http://www.tornadostream.com <--check this

*Must Read* http://www.smithmediafusion.com/blog
Back to top
darrel

External


Since: Jul 31, 2006
Posts: 1031



(Msg. 3) Posted: Thu Apr 05, 2007 1:24 pm
Post subject: Re: AJAX vs PHP includes
Archived from groups: per prev. post (more info?)

> Could someone tell me the difference (advantages/drawbacks) of using PHP
> includes vs AJAX to assemble web pages that recycle many of the same
> elements?

AJAX depends on the client-side. So it's much more volatile than anything
you do server side.

For ease of site management and using includes for that, you definitely want
to do that server-side.

AJAX can be useful for certain user interface enhancements, but shouldn't be
seen as a replacement for regular includes.

> Is it the ability to never have to change webpages once you're on the
> site?

While you can do that with AJAX, that's actually one of the bigger
drawbacks.

-Darrel
Back to top
Gary White

External


Since: Jul 28, 2006
Posts: 930



(Msg. 4) Posted: Thu Apr 05, 2007 1:24 pm
Post subject: Re: AJAX vs PHP includes
Archived from groups: per prev. post (more info?)

On Thu, 5 Apr 2007 12:50:32 -0400, "R.J." <no RemoveThis @spam.com> wrote:

>Could someone tell me the difference (advantages/drawbacks) of using PHP
>includes vs AJAX to assemble web pages that recycle many of the same
>elements?


There are some things that AJAX does very well. Want to see a good one?
Take a look at the scoreboard on ESPN's site:
http://scores.espn.go.com/mlb/scoreboard

When games are in process, the scores will update constantly. That's
something that you can't really do without AJAX.

However, using AJAX as a primary tool for serving content is not one of
the things AJAX does well. For one thing, it *requires* JavaScript in
order to function at all. Even when JavaScript is available, as it is
most of the time (but not all), it encounters many of the same issues
you get when using frames.

For example, the third item on the page you linked to allows the user to
switch the content of the bottom section of the page. What if I wanted
to direct you to that content? I cannot send you a link because there is
no link to that content. In this case, I'd have to send you the link to
the page and tell you to click the link in the bottom section. It's
relatively simple in this case, but what if the site were more complex?
It could well be a go here, click this, click that and then click
something else.

Search engines don't execute JavaScript, so they will never find that
other content.

When using includes, be they PHP, ASP, or SSI; each page is a separate
resource, with a unique URI that identifies it. None of the above issues
apply.

Gary
Back to top
R.J.

External


Since: Apr 05, 2007
Posts: 38



(Msg. 5) Posted: Thu Apr 05, 2007 3:35 pm
Post subject: Re: AJAX vs PHP includes
Archived from groups: per prev. post (more info?)

"Gary White" <reply RemoveThis @newsgroup.please> wrote in message
news:b1fa13ljop7lulql46ilr3mj0g1u4clu1d@4ax.com...
>
> For example, the third item on the page you linked to allows the user to
> switch the content of the bottom section of the page. What if I wanted
> to direct you to that content? I cannot send you a link because there is
> no link to that content. In this case, I'd have to send you the link to
> the page and tell you to click the link in the bottom section. It's
> relatively simple in this case, but what if the site were more complex?
> It could well be a go here, click this, click that and then click
> something else.

You're right, that is a definite and major drawback. Is there no way around
this? No way to "assemble" the page via its url, the htaccess file, or a
combination thereof?
Back to top
darrel

External


Since: Jul 31, 2006
Posts: 1031



(Msg. 6) Posted: Thu Apr 05, 2007 3:35 pm
Post subject: Re: AJAX vs PHP includes
Archived from groups: per prev. post (more info?)

> You're right, that is a definite and major drawback. Is there no way
> around
> this?

Yes, don't make your entire site one AJAX page. ;0)

-Darrel
Back to top
Gary White

External


Since: Jul 28, 2006
Posts: 930



(Msg. 7) Posted: Thu Apr 05, 2007 4:14 pm
Post subject: Re: AJAX vs PHP includes
Archived from groups: per prev. post (more info?)

On Thu, 5 Apr 2007 15:35:54 -0400, "R.J." <no RemoveThis @spam.com> wrote:

>You're right, that is a definite and major drawback. Is there no way around
>this? No way to "assemble" the page via its url, the htaccess file, or a
>combination thereof?

I agree with Darrel. Here's why. The only way to have a unique URI for
dynamic content would mean that you'd have to reload the entire page.
Using AJAX, you could then choose which content do display based on
parameters passed to the page.

However, if you're doing that, then why rely on an optional technology
like JavaScript when you can assemble the whole thing on the server
before sending it to the client? Assemble it on the server, then you
know you have a bullet-proof page.

Like I said, there are some good uses for AJAX, but this is definitely
not one of them.

Gary
Back to top
David Powers

External


Since: Jul 29, 2006
Posts: 1210



(Msg. 8) Posted: Thu Apr 05, 2007 6:40 pm
Post subject: Re: AJAX vs PHP includes
Archived from groups: per prev. post (more info?)

R.J. wrote:
> Could someone tell me the difference (advantages/drawbacks) of using PHP
> includes vs AJAX to assemble web pages that recycle many of the same
> elements?

View the source of that page. You will immediately see the disadvantage
of Ajax. The source code says "empty div for dynamic content". Now view
a page generated by PHP. The content is there in the underlying code.

Used indiscriminately, Ajax has serious drawbacks when it comes to being
search engine friendly.

--
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Back to top
Murray *ACE*

External


Since: Jul 29, 2006
Posts: 13227



(Msg. 9) Posted: Thu Apr 05, 2007 6:40 pm
Post subject: Re: AJAX vs PHP includes
Archived from groups: per prev. post (more info?)

And, accessable....

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"David Powers" <david RemoveThis @example.com> wrote in message
news:ev3cac$sbg$1@forums.macromedia.com...
> R.J. wrote:
>> Could someone tell me the difference (advantages/drawbacks) of using PHP
>> includes vs AJAX to assemble web pages that recycle many of the same
>> elements?
>
> View the source of that page. You will immediately see the disadvantage of
> Ajax. The source code says "empty div for dynamic content". Now view a
> page generated by PHP. The content is there in the underlying code.
>
> Used indiscriminately, Ajax has serious drawbacks when it comes to being
> search engine friendly.
>
> --
> David Powers, Adobe Community Expert
> Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
> Author, "PHP Solutions" (friends of ED)
> http://foundationphp.com/
Back to top
R.J.

External


Since: Apr 05, 2007
Posts: 38



(Msg. 10) Posted: Thu Apr 05, 2007 9:34 pm
Post subject: Re: AJAX vs PHP includes
Archived from groups: per prev. post (more info?)

"Gary White" <reply RemoveThis @newsgroup.please> wrote in message
news:fcpa13di9n31rdm32b61kmde4o3m82dbtd@4ax.com...
> On Thu, 5 Apr 2007 15:35:54 -0400, "R.J." <no RemoveThis @spam.com> wrote:
>
>>You're right, that is a definite and major drawback. Is there no way
>>around
>>this? No way to "assemble" the page via its url, the htaccess file, or a
>>combination thereof?
>
> I agree with Darrel. Here's why. The only way to have a unique URI for
> dynamic content would mean that you'd have to reload the entire page.
> Using AJAX, you could then choose which content do display based on
> parameters passed to the page.
>
> However, if you're doing that, then why rely on an optional technology
> like JavaScript when you can assemble the whole thing on the server
> before sending it to the client?

If you're building a band site and want a flash music player to play a song
uninterruptedly, you couldn't do it any other way but frames or AJAX... no?
Back to top
Gary White

External


Since: Jul 28, 2006
Posts: 930



(Msg. 11) Posted: Fri Apr 06, 2007 5:36 am
Post subject: Re: AJAX vs PHP includes
Archived from groups: per prev. post (more info?)

On Thu, 5 Apr 2007 21:34:46 -0400, "R.J." <no.DeleteThis@spam.com> wrote:

>If you're building a band site and want a flash music player to play a song
>uninterruptedly, you couldn't do it any other way but frames or AJAX... no?

Personally, I'd open the music player in a pop-up window.

Gary
Back to top
darrel

External


Since: Jul 31, 2006
Posts: 1031



(Msg. 12) Posted: Fri Apr 06, 2007 11:13 am
Post subject: Re: AJAX vs PHP includes
Archived from groups: per prev. post (more info?)

> If you're building a band site and want a flash music player to play a
> song uninterruptedly, you couldn't do it any other way but frames or
> AJAX... no?

To wrongs won't make a right. ;o)

If you really want music constantly playing (which may or may not be what
your end-users want) then AJAX is overkill for that. You might as well just
make the whole site a Flash site.

-Darrel
Back to top
R.J.

External


Since: Apr 05, 2007
Posts: 38



(Msg. 13) Posted: Fri Apr 06, 2007 11:29 am
Post subject: Re: AJAX vs PHP includes
Archived from groups: per prev. post (more info?)

It would get blocked 99% of the time. It would also require switching to
another window to manipulate (lower volume, fast-forward, etc.)

But I take it this means the answer is yes, AJAX (or frames) is the only way
to do this in the same window. One of those rare instances where AJAX for
layout purposes is actually called for.

"Gary White" <reply.RemoveThis@newsgroup.please> wrote in message
news:0l8c1356g81ukj83264m9e7f85ipibbeg8@4ax.com...
> On Thu, 5 Apr 2007 21:34:46 -0400, "R.J." <no.RemoveThis@spam.com> wrote:
>
>>If you're building a band site and want a flash music player to play a
>>song
>>uninterruptedly, you couldn't do it any other way but frames or AJAX...
>>no?
>
> Personally, I'd open the music player in a pop-up window.
>
> Gary
Back to top
Gary White

External


Since: Jul 28, 2006
Posts: 930



(Msg. 14) Posted: Fri Apr 06, 2007 12:14 pm
Post subject: Re: AJAX vs PHP includes
Archived from groups: per prev. post (more info?)

On Fri, 6 Apr 2007 11:29:23 -0400, "R.J." <no DeleteThis @spam.com> wrote:

>It would get blocked 99% of the time. It would also require switching to
>another window to manipulate (lower volume, fast-forward, etc.)

Pop-up blockers don't usually block pop-ups that are activated via an
onClick event handler. In other words, if the user clicks something that
opens a pop-up, it's considered a requested pop-up and is allowed by
almost all pop-up blockers. It's only the automatic pop-ups that are
triggered onLoad or some other passive event that are normally blocked.


>But I take it this means the answer is yes, AJAX (or frames) is the only way
>to do this in the same window. One of those rare instances where AJAX for
>layout purposes is actually called for.

Not for me. If you're looking for an excuse to use AJAX, just use it.
However, there is no real value in it for this and it will complicate
your life greatly.

Gary
Back to top
R.J.

External


Since: Apr 05, 2007
Posts: 38



(Msg. 15) Posted: Fri Apr 06, 2007 6:45 pm
Post subject: Re: AJAX vs PHP includes
Archived from groups: per prev. post (more info?)

"Gary White" <reply.RemoveThis@newsgroup.please> wrote in message
news:fpvc131ubj5htkcrvnc6915ueea6rl0osq@4ax.com...
> On Fri, 6 Apr 2007 11:29:23 -0400, "R.J." <no.RemoveThis@spam.com> wrote:
>
>>It would get blocked 99% of the time. It would also require switching to
>>another window to manipulate (lower volume, fast-forward, etc.)
>
> Pop-up blockers don't usually block pop-ups that are activated via an
> onClick event handler. In other words, if the user clicks something that
> opens a pop-up, it's considered a requested pop-up and is allowed by
> almost all pop-up blockers. It's only the automatic pop-ups that are
> triggered onLoad or some other passive event that are normally blocked.

That explains why Darrel brought it up, now. Gotcha.

That said, every site that autoplayed when I brought up the page... if the
music was good... I'd usually let it play. And even discovered 2 new bands I
eventually bought albums of this way.

However, every time I've visited a band page (usually by accident) and it
waited for me to activate the music... I never did.

Let's face it... if commercials were optional, nothing would ever get sold.
And if we all had our way, we'd listen to nothing but songs we already know
on the radio, and eventually just phase it out of our lives. It's what's
imposed on us that often becomes habitual.

If it wasn't for Sony paying off DJ's with plasma screens and trips to the
Bahamas to play their new artists, we'd never hear about them. There just
isn't any demand for the unknown. Similarly, no one will hit PLAY on a
player unless they know the band and song (exceptions notwithstanding).

>>But I take it this means the answer is yes, AJAX (or frames) is the only
>>way
>>to do this in the same window. One of those rare instances where AJAX for
>>layout purposes is actually called for.
>
> Not for me. If you're looking for an excuse to use AJAX, just use it.
> However, there is no real value in it for this and it will complicate
> your life greatly.

Understood, and I appreciate all your input. I'll think it through. But so
far, there has only been 1 (very good) argument against all-ajax layouts
that don't refresh the screen (that you can't link to specific content
easily from the outside).
Back to top
Display posts from previous:   
       Webmaster Forums (Home) -> Macromedia Dreamweaver
Goto page 1, 2
Page 1 of 2

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum