Welcome Guest, Not a member yet? Register   Sign In
jquery and IE 6
#1

[eluser]treadsoftley[/eluser]
Has anyone else come across this?

I have found that when I am loading views as a string for IE 6 to see it I also have to load the identified element as a string then it all works.
Safari, firefox seem OK with it just being static but not ie6.

For example:

Code:
//HEAD javascript

        $(document).ready(function(){
        loadProjects(1);
        
        $("#pj2").click(function(){
        loadProjects(2);
        });

    //JS function below loads a view as a string e.g.
    //function loadProjects($id){ print $this->load->view('projects',$data,TRUE); }    
    function loadProjects(id)
    {
       $("#projects").load("loadProjects/"+id);
    }
                                    
});

Somewhere on the page I'd normally just have this:
Code:
<div id="projects></div>

But for ie6 I have to fly in the div as a string too:
Code:
//in controller
$data['div'] = $this->load->view('div','',TRUE);

//and then in the view 'div.php'
<div id="projects></div>

//in the 'master' view
&lt;?=$div?&gt;

Weird???!! Have you noticed this .... or what am I doing wrong to have to employ this workaround?

Anyway, just thought I'd mention it just in case anybody else is stuck in a similar universe!
#2

[eluser]TheFuzzy0ne[/eluser]
[url="http://validator.w3.org/"]Is your HTML valid[/url]? I don't know if that's a typo in parts where you pasted your div declaration, but if it's not, that would undoubtedly be causing your problem.
#3

[eluser]treadsoftley[/eluser]
Yup the html is valid - just a typo above should be '<div id="projects"></div>' - should've previewed it.
#4

[eluser]TheFuzzy0ne[/eluser]
By valid I mean that it has a valid doctype and is successfully validated by the validator? Sorry, I just need to be sure has different peeps seem to have different views on "valid markup"
#5

[eluser]treadsoftley[/eluser]
This is the full doctype .....
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;

Haven't run this page through a validator as it is a backend one .... I'll see what something like dreamweaver says.
#6

[eluser]treadsoftley[/eluser]
bbedit has given me a few validation errors so when i get a chance I'll clean these and see what happens. Thanks for the advice Smile




Theme © iAndrew 2016 - Forum software by © MyBB