[jQuery] Re: Problems using $.load() on remote contentw ith a large dropdown (select)

2008-11-19 Thread Elwood Casey
Can't do an online demo at the mo, I'm afraid.

A screenshot from FF?
http://i421.photobucket.com/albums/pp298/elwoodcasey/dropdown_error.jpg
See how the options look different from normal text on the page!

On Wed, Nov 19, 2008 at 10:46 AM, Liam Potter <[EMAIL PROTECTED]>wrote:

>
> can we seen an example?
>
> the_woodsman wrote:
> > Hi all,
> >
> > I have a html page with a massive (200+ options) drop down:
> >
> > 
> > United Kingdom
> > Afghanistan
> > Aland Islands
> >  etc etc!
> >
> > By itself, this paeg loads fine.
> > When I try to ajax load it using .load, the select box doesn't render
> > properly in any browser - IE gives an empty select, and dumps the
> > countries beneath it, Chrome has an empty select and no sign of the
> > countries.
> >
> > Firefox displays an empty select with the countries beneath, but the
> > countries are formatted as if they were in a select!
> >
> > My first thought was that it's invalid markup, but I can't find
> > anyhting, and as I said it renders fine if you call the page directly
> > and not via AJAX.
> >
> > Anyone seen anything like this before?
> >
> > Thanks in advance...
> >
>
>
> >
>


[jQuery] Re: Best event for changing the content of a div?

2008-11-05 Thread Elwood Casey
Correct: I'm not trying to change the content before the div loads.
I'm trying to change it at the soonest possible opportunity, but without
inline script!
I'm hoping for an event that fires on a per element basis, when the element
is ready - i.e $(element).ready().

The only event that seems to match is load(), but I can't get this to
fire...



Looking at the docs, the load() event might be what I'm after

On Wed, Nov 5, 2008 at 5:59 PM, Chris <[EMAIL PROTECTED]> wrote:

>
> I could be mistaken here, but doesn't jQuery (or javascript for that
> matter) need the DOM to be loaded before you can start selecting
> things from it?
> You could put the script elsewhere on the page, but you're still going
> to have to wait for that div to load before you can change its
> contents. If you to insert content before the page loads, you're going
> to have to use some server-side programming, not javascript.
>
> - Chris
>
>
> On Nov 5, 11:12 am, Klaus Hartl <[EMAIL PROTECTED]> wrote:
> > If you don't want to put a script after the div it won't get any
> > faster then DOM ready.
> >
> > You could although poll for that element. Say it had an id of
> > 'asap' (untested):
> >
> > (function() {
> > var f = function() {
> > var div = document.getElementById('asap');
> > if (div) {
> > // alter content here...
> > } else {
> > setTimeout(f, 30);
> > }
> > };
> > f();
> >
> > })();
> >
> > --Klaus
> >
> > On 5 Nov., 16:30, the_woodsman <[EMAIL PROTECTED]> wrote:
> >
> > > Hi,
> >
> > > I want to change the content of a div asap.
> >
> > > I know about document.ready, but if possible I'd rather do this
> > > earlier. I'd also rather do it as an event instead of loading a script
> > > file after the div appears in the page.
> >
> > > I tried the load() event, but this didn't seem to fire at all.
> >
> > > Anyone got any tips on this?
> >
> >
>
> >
>