Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8517203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:38:01+00:00 2026-06-11T05:38:01+00:00

The Website The developing build can viewed at randomactsofviolet.com Included libraries : vaccordian mousewheel

  • 0

The Website

The developing build can viewed at randomactsofviolet.com

Included libraries :

  • vaccordian
  • mousewheel
  • jquerytools
  • easing

vaccordian embeds a ‘scrollable’ element (JQuery tools) to shift up & down various pages of content

Aim

I’m trying to load dynamic content using JQuery’s/Ajax .load() method and passing it a URL that I’m retrieving using JQuery’s .data() method. It might be noting that im also testing whether or not the content has already been loaded using a data attribute ‘state’ and only calling the load() function if state is undefined.
I was under the impression that both my syntax and use of data-attributes was correct as I had managed to get full functionality within firefox and dreamweaver’s preview window but it soon become evident that my method didnt work in chrome or IE9.

As far as my research suggests both the .data() method and were both supported across browsers since .data() is included in jquery 1.4+.

Could the problem lie within my syntax?
If there is an alternative method then Id appreciate suggestions.

Steven Dons make a good argument why I shouldnt be using attr(). :

Could, but should not, especially when manipulating the data rather than reading them. >With attr(), the data goes back into the DOM. With data(), it is kept separately. If you >change a value with attr(), then read it with data() you will get different values. Also >attr() deals with strings only, data() will convert to native types, like integers. >Whatever you do, don’t mix use of attr() and data() unless you really know what you’re >doing. My rule of thumb is to use attr() for reading original DOM metadata or changing DOM >properties and using data() for application state. – Steven Don Mar 17 at 10:44

The current syntax

$('.va-slice').bind("expand", function(evt) {
                // bind an 'expand' event and test for defined state of slice
                if (typeof $(evt.target).data('state') === 'undefined') {
                    //if undefined, find the content div within the target and store its url attribute
                    var url = $(evt.target).find('.va-content').data("url");
                    //then load the url into the div using ajax
                    $(evt.target).find('.va-content').load(url);
                    //Set state attribute as expanded
                    $(evt.target).data('state', 'expanded');
                } else {
                    //Just set the state to expanded & allow the accordian script to open the panel
                    $(evt.target).data('state', 'expanded');
                }
            }).bind("collapse", function(evt) {//collapse function
                $(evt.target).data('state', 'collapsed');                   
            }).toggle(function() { // toggle between functions
                $(this).trigger("expand");
            }, function() {
                $(this).trigger("collapse");
            });


//note the line $(evt.target).data('state', 'expanded'); in else definition is not present on the live site,but is in my local version and doesnt affect the issue in question.

The HTML in use

<div class="va-slice about">
            <h3 class="va-title">About</h3>
            <div class="va-content" data-url="about.html">
            <div class="loadspace"></div>
            </div>
        </div>

My investigation

Either the URL is not being retreived from the div elements or the there is something incorrect with my ajax use?
Javascript is enabled.
I have done a fair bit of reading on stack and have comes across some other useful problems around this topic and learnt a few usefuls considerations but non are able to clarify the problem in this scenario.
Potentially I can see this being something annoyly simple that ill hopefully never forget like having to tell the browser at the top of your html to enable something or allow certain syntax
I think perhaps if it is a problem with jquery syntax then this could be clear from within firefox’s inspector. Can anyone also explain how to use it to view live messages/errors , or methods of diagnosing problems using the inspector ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T05:38:02+00:00Added an answer on June 11, 2026 at 5:38 am

    Code looks ok, but if you will take a look at network tab of Developer Toolbar/firebug/inspector (F12 in all browsers), you will see that all items in “Portfolio” section request return 404 (File not found). In FF’s firebug there is also such tab, but you may need to enable it and open Firebug before you click on a div. Possibly – your urls are incorrect. Or you have no files on server. About firebug – frankly speaking have no idea what to tell about it. In case of errors there will appear a message somewhere in its window. Hard to miss it. Click on it will open console. Click on some message will show you a line in JS code where error happened. In scripts tab you can set breakpoints, view variables state etc. Basically just like in any IDE with debugger. Just google about firebug and its features.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a small testing website using Django 1.2 in Aptana Studio build
I am developing a website and I need to build a data structure to
Im developing a website about travels. My needs is to build a view that
Currently I am developing website in asp.net. I wanted to include spellchecker module into
I'm developing a website for a client of ours and have been having a
I'm developing a website and a sizable portion of the viewers will be using
I am developing a website in asp.net using dotnetnuke cms. I need to add
I'm developing this website: http://parkoura.tk/a/sandbox/ I am using an ajax navigation. I have a
I am developing a website in which a cookie is set when the user
I'm developing a website, and part of the content will be a live 'departures

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.