live() and on() method, and FF browser - jquery-selectors

I have this code that use live method, and it works in Opera and Chrome:
$(".dynamicaly_created_div").live("click",function(){
$(event.target).parent().remove();
});
But not in the FF. So i tried to replace "live" with "on" (i read somwhere that live is deprecated). But then, this does not work in any browser.
Is ther any solution for this?

Have you tried passing the event into the function?
$(".dynamicaly_created_div").live("click",function(e){
$(e.target).parent().remove();
});

Related

Protractor test failed only in firefox (due to retrieve the option in a select box)

I am using protractor 3.0 with firefox 44 and chrome. My test passed when I use chrome, but some of my test (mostly the test involving select field) failed with firefox. I used this to retrieve the proper option
mySelect.element(by.cssContainingText('option', "Terminology")).click();
(I tried using this function and I had same result )
mySelect.all(by.css("option")).each(function(option){
option.getText().then(function(text){
if(text=="Terminology"){
option.click();
}
})
});
Any idea about It ?
Martin, try this and see what happens?
mySelect.element(by.cssContainingText('option', "Terminology")).click();
browser.actions().sendKeys( protractor.Key.ENTER ).perform();
If it does work then the cause might be because the model isnt being updated on the click call
Thank you TesterPhi
You solution is working on firefox however it failed with chrome.
But at the end the
mySelect.sendKeys("Terminology")
is working with both chrome and firefox,but I think is not a very good way to do it.

appAPI.notifier.show sometimes not work

i have a problem with Crossrider code.
I want to display notifier with this code:
appAPI.notifier.show({
'name':'my-notification-name',
'title':'Title',
'body':body_popUp,
'theme':'facebook',
'position':'bottom-left',
'close':false,
'sticky':true,
'fadeAfter':1,
'width':'700px',
'closeWhenClicked':false
});
but sometimes work, sometimes not work.
Do you have an idea? I have to write any instructions before call .show()?
Thanks in advance, Mattia
You don't show what body_popUp is set to but, assuming it's valid HTML and it's placed in the extension,js file, the code look fine.
In general, note that the notification is smart and only appears when it detects user movement in the browser. This algorithm is used as a way to ensure that the notification is seen, as it assumes the user is looking when activity is detected.
[Disclosure: I am a Crossrider employee]

Facebook pay.prompt callback fails in IE with wmode=window

My Flash app calls:
Facebook.ui("pay.prompt", data, onPayCallback, "iframe");
which works correctly on all browsers, until a recent change in the embedding of the swf file. I now use wmode="window" which gives much better performance in IE (previously I used "opaque").
When the facebook credits popup appears, the game is now hidden as expected. It returns correctly when the popup is closed. However, on IE (version 9, other versions are untested) the callback is never called.
Any ideas please?
Did you manage to get any further on this?
In my case the javascript callback is triggered, and the call to the flash function is also being made, but throws an error "Object required".. with a little bit more digging (using IE's developer tool) the addcallBack function in the swf was null..

Can't write code in FBrell code window

At fbrell.com I want to test some code and to see code of theirs existing examples. But, in none of the following browser IE8, FF3, Chrome I can't write anything in the text area. When I go to Save Code of an existing example there is for a second shown code of that example and after that it dissapears. Same thing happens at my home and my work PC.
Googling about this problem wasn't successful.
How to do it?
FBrell console is implemented in Facebook, JavaScript Test Console try it if it didn't work, try clearing the cache.

Periodically calling TinyMCE's triggerSave function

If anyone knows TinyMCE well, do you know if it has built-in support for periodically calling its triggerSave function?
(This function copies it's content to its "parent" textarea. I want to observe said textarea for changes so I can implement autosave.)
Thanks
Don't try autosave, trust me on this one. triggerSave is buggy and when it fails it fails silently so you think that your content got posted, but in reality it didn't. After it fails once it will no longer work for the rest of the session, as in until the page is manually reloaded and tinymce does another full init().
Just got bit by this one badly, again. Never again trust triggerSave.
You could easily do this yourself by using JavaScript's setTimeout() function.
See http://www.w3schools.com/js/js_timing.asp.