0

The idea is have a jQuery snippet (I like Jquery...I can understand it better then regular javascript) that will detect that when it has been run on a profile with a url such as "http://customize.forum-motion.com/profile.forum?mode=viewprofile&u=1" (just as an example)...then upon detecting that it is a url of a profile...fetch data from a specific (and most likely hidden) element before wrapping that data in css tags and appending it to the heady of the current document.

In short I'm trying to figure out how to make a sort of profile customization system where users can create their own css. The biggest problem I am having so far is figuring out how to make it so that the snippet can figure out what URL its being run on. Is there a function that can do this in jQuery at all?

Harvengure
  • 21
  • 1
  • 3

1 Answers1

0

To get the current URL:

$(location).attr('href');

There's a plugin for URL processing too. See also:

Get current URL in JavaScript?

Community
  • 1
  • 1
  • Any thoughts on how to have it so that the snippet is able to figure out that it's on a url with 'mode=viewprofile&u=1' and then using some sort of formula where it figured that if 1 is the profile its viewing it takes that variable and uses it to complete the URL in which it searches for the information this plugin I am trying to make to use? So if it were 21 it would go to profile 21's other page to look for the div containing the potential css. – Harvengure Jun 11 '10 at 23:57