Is that supposed to mean that you tested the url, and it’s fast? Or, maybe I interpreted wrong, and the loading is not the problem, just the response time after a click event? What about a simple alert(“hi”)?
I think were about at the point where we need to see an example page that demonstrates the issue. Do you have any other event handlers on the same page?
It’s the onclick event on the input. When You click on the input its suppose to clear the default value and on blur, if empty, show the default value again.
In order for this to work, I have to focus the input, then blur, and focus once again. Only then will it work correctly.
Ok, now I understand what you’re on about. So, there was never really a 5-10 second delay…It was that the first click didn’t work.
Personally, I would rip out the inline onclick code, and just assign the event handlers right after the element becomes available in the document. You could also use live() for stuff like this.
The reason you were having that problem is because the first click event happened before there were the focus and blur event handlers attached to the element.
$('#searchName').live('click', function () {
$(this).input();
});
But the code you provided works extremely fast. thank you!
Another question though.
I have a php loop going on for another page I have. It’s an inline function because the parameters will always be unique. I’m having the same issue with the load as well.
Using live() on the click event gets you back to square one, with the same exact problem we just solved. You don’t care about click. You care about focus and blur.
Edit - but live() doesn’t support focus/blur, so nevermind.
For your other problem, just use a different selector. You can access elements in other ways besides using an id. For example, the tagname, or a classname, or any other css selector.
This issue is due to your code/design/decisions. The logic is at fault, not the library. The library just enables less code to be used to express the same logic.
What would u recommend ? I have 3 sections I would like to apply this functionality but it would be a pain in the butt to have to call all my js functions to have them work correctly.
It becomes an even bigger hassle if I have 3+ sections with this type of hashing.