how to, javascript Pop Under not popping in the background - javascript

i have this simple script of a popunder window:
function loadpopunder(){
win2=window.open(popunder,"",winfeatures)
win2.blur()
window.focus()
}
It works but it looks like the new window doesn't load under the main one. it loads on top.
i've been looking at this from multiple ways and i can't figure it out.
any ideas?
thanks
edit: this code is just a sample, mine actually has all the ; and the http://.. link,
also, i understand that none likes the popunders, i don't like them either, is just one of those things that needs to be done. I hope one day someone will figure a way of blocking those too, but i am here bcause i am looking for a solution

Please reconsider your choice. There are about zero people that enjoy pop-unders.
For the sake of answering your question, here is what's considered a better way: http://icant.co.uk/articles/how-to-create-popunders/

Related

Multiple ids in jQuery selector not working?

Apparently my note was removed. This is very similar to other answers already out there. I explained that I have tried them all and nothing has worked for me. There are 7 or 8 possibilities I found here on stackoverflow and had no luck with them. There is something I'm missing and can't figure it out. Please help!
We have a script that creates a vehicle selection tool on our dev website. It works great when a single use is in place. However, if there are two versions they conflict. Each instance has a unique id and no matter how I code it, they will not work together. Its probably something obvious, but I don't have the experience to spot it. I've tried all the solutions I could find to attempt to correct the problem and I keep falling short. Depending on how I do the id selectors I can get one or the other to work, but not both. I'm sure it's something obvious that I just don't have the experience to discover.
Code snippets:
function selectVehicleDialog(showCloseButton) {
jQuery("#select-vehicle,#select-vehicle2").dialog('open');
if(showCloseButton == true){
jQuery('.ui-dialog-titlebar-close').remove();
}
loadVehicleFinder('-header');
}
Extensive code trimmed out here as requested
});
When they are both on the page simultaneously, I can change the selectors and make one or the other work.

Youtube, the site itself freezing for a few seconds

i've been plagued by a problem that seem to started since Youtube's last
layout change this year.
I have for months put up and tried to ignore the freezing that happens
everytime I open a link within youtube such as an channel, an video, the homepage, etc.
I'm using Chrome version 31.0.1650.63 and I have already tested youtube without any
extensions, cookies, cache, etc but it still affects me to this day and maybe some
of you out there.
I searched every where for the solution and couldn't find any anywhere.
I did a bit of digging and testing to see what is the root of the problem and
while i'm no expertise on code or Java...I did found something.
Every time I reload a page on youtube, with it finishing loading up...this happens:
http://i.imgur.com/K9Z3vJ1.png
See that?
The purple-colored rendering, that's the cause of the lag every time I load
up something on youtube!
I notice that it repeats the same thing over and over again for like 5-15 or so
seconds before it starts loading up the thumbnails of the videos.
If you want a closer inspection of the code, here's the raw data from the timeline (that you can load up in chrome's dev timeline window):
Youtube Lag JSON Timeline file
I don't what to do with this problem and I believe it affects
me in Firefox as well but to an lesser extent then chrome.
Do any of you guys know how to resolve this problem?
Honestly I doubt that the youtube devs will fix this problem since they're the ones who caused it in the first place. (Like not being able to subscribe to some people when i'm not even at my sub limit.)
I'm sorry if you don't want to help but I don't know who else to look to besides
the experts that y'all are when it comes to web coding. If anything, I believe a userscript or something similar could help with this but how...I don't know.
I'm new to this and I apologize if the question i'm asking isn't suited for this site.
Still, thanks for reading and if you can...please reply.
That is all and thanks again.
Well I was fiddling around and looking at the source code
with chromes timeline devtools and well...
I found a temporary solution to the problem which seems to have
fixed and ended the freezing on youtube! yay~
But some things don't work with this solution and i'm at
a fault with this issue after some hours trying to figure out
how to stop the problem.
Anyways I used adblock, an extension that I have on Google Chrome, to deal
with this issue and was able to get everything fixed and working!
What I did was, in the custom filters section (check options in your
adblock extension, you should have it.) and added the following then did
some testing to see if it fixed the problem which it did!
Here are the filters I used to fix it!
||s.ytimg.com/yts/jsbin/www-pageframe-*
*www-pageframe-*.js
^^^
Yeah, that's the temporary solution as it fixes the problems but it causes the following...
You can't open the menu which contains links to your playlists, user settings, channel, etc when you click your username or profile
picture on top right of youtube.
The "..." mini-menu that you usually find on the right of a video section (to hide, subscribe, etc.) doesn't appear anymore.
Youtube's quick menu button doesn't work, however the menu is still open but you won't be able to close it. That or it's close and you
won't be able to open it...I guess.
Those are the problems I found with this temporarily solution to the freezing problem.
Yeah...but I hope this helps anyone who's having this problem somewhat well.
But it would be nice if someone has an better solution then mine hehe!
Thanks for reading and if you have a better solution, don't feel afraid to
tell! ^_^
I'll be awaiting other answers, for now...I hope this helps y'all well
in some ways hehe! =D
This certainly isn't javascript, but substituting the normal EasyList in ABP for EasyList without element hiding will fix the issue. There are downsides to this as well but for now seems to be the better solution.

Opening an about: link in firefox

Okay, so, I've been feeling like pulling my hair out on this one. I'm making my own homepage for school use, so I can easily and quickly do things.
I've hit a brick wall: You can't open "about:" links for whatever reason. Not using regular href="about:(target)", not using window.open("about:(target)","_self");. Any other links work fine, but as soon as I change it to about:, nothing happens. At all. Might as well not have pressed it.
If anybody has any solutions, that's be greatly appreciated. They don't have to be cross-browser compatible, because I'm only using firefox. If the information is needed, I use Firefox 18 (I may update it next week).
Did you try to use window.location.assign?
link

Toggle multiple div elements

On my page I'm currently doing something like this: http://jsfiddle.net/FBCSt/6/ I really don't know why, but in Chrome I got some strange issues with that - sometimes the contents of the div elements are not loaded correctly. In IE, Safari and Firefox it work fine, but as I said, in Chrome it is causing some trouble.
That's why I want to know, if there is a more sleek way to do this? (There are three buttons, every one is assigned to one div. Only one div should be visible)
I am thankful for every answer =)
EDIT: Thanks everybody. This is the solution. It works well =)
"a better way: jsfiddle.net/FBCSt/13 – #Mohammed ElSayed 20 mins ago"
Try this: http://jsfiddle.net/FBCSt/10/
In IE, Safari and Firefox it work fine, but as I said, in Chrome it is
causing some trouble.
I really don't see an issues when testing under Google Chrome 19.0.1084. But in any case,
That's why I want to know, if there is a more sleek way to do this?
Yep, there is. Since one of your tags is jQuery, I suggest you take a look at jQuery UI's tabs.
Why don't you use show() instead of toggle()? Maybe the issue is related to using toggle(). And you can combine the elements to be hidden: For example,
$('#page2,#page3').hide();
$('#page1').show();
Or as nicely put by Mohammad,
$('#page1').show().siblings().hide();
I have working solution on this url : pastebin it works in chrome and also in FF.also it will work even if you add 1000 id with page#100 but still it will not have too much code. thanks.
Like Abody97 said: try JQuery UI tabs
If you're looking for a "more sleek" way of doing this, try this fiddle: http://jsfiddle.net/NCbW6/
It doesn't bother with specific ids for each element so you can add as many as you'd like without changing the JS.

Code (ok in other browsers) working in Firefox only when clicking back button / on.load

So heres my problem:
The code only works, when I leave the page to a different url (in the same browser window) and then press the back button.
What could be the reason for such an odd behavior? Any hints where and what to look for?
I know its not a specific question but a general one, because i hope to get guidance so someone can hint me to the "desease" by me describing the symptons (Dr.House-style) so I get a good start for finding the bug.
So i hope this is ok to ask.
Anyhow, if it needs to be specific, here is the code that is acting so strangely:
2 scripts (FitVids.js, Vimeo.js) together kill Calling a function to play video, resulting in: VimeoAPI is not a function
I would assume that means that VimeoAPI is not a function. :) You may be spelling it wrong, capitalizing it wrong, or it may not be defined yet. Try posting your code clearly on your post.

Categories

Resources