@selector() in Swift?

Swift itself doesn’t use selectors — several design patterns that in Objective-C make use of selectors work differently in Swift. (For example, use optional chaining on protocol types or is/as tests instead of respondsToSelector:, and use closures wherever you can instead of performSelector: for better type/memory safety.) But there are still a number of important ObjC-based APIs that use selectors, including timers … Read more

How to load script with jquery.load()?

When you say “the script doesn’t work” do you mean there’s javascript in the page you’re loading through ajax? It’s not going to work, ever, at least not directly. You have two choices. Parse out the script from the content you’ve loaded, and use eval to run it. A better way is to use $.getScript to load (and execute) … Read more