Much like karma- this "law" of attraction is utter rubbish.
First and foremost, for something to be a law it needs to go through enough testing to be proven to be a factual circumstance in the universe. I can guarantee you that this isn't the case with the "law" of attraction.
Secondly, much like karma, the "law" of attraction, is governed by selective and confirmation biases. The way both ideas work is that you're more willing to recreate and pick out situations that confirm what you so firmly believe in. This, "law" of attaction-wise, basically means that you're forcing the "law" of attraction to prove true. If you think you're going to get yourself a girlfriend then you'll most likely try and get a girlfriend. You'll pick out any aspects of your life relating to the that subject and take special note of them. By doing so you'll eventually succeed in your goal because you're actively seeking to succeed in that goal by setting your mind to it in the first place. It's not so much a mystery of science as it is the way of life. Try, try, try and you'll succeed. That's basically all the "law" of attraction sums up to.
Now karma is another subject that amounts to nothing but a simple proverb. Do unto others as you would want them to do unto you. The whole premise of karma is the fact that what you do will come back to you in some way, shape, or form. There're varying degrees of return in each individual's belief but the basic idea remains the same throughout. This is a larger example of selective and confirmation biases and it in fact goes beyond that. The first thing to know about karma is that a believer is going to be looking for hints of it every chance they get. Drop a quarter and it rolls into the sewer- that's karma!
"I should've never took that extra penny from the penny tray at the gas station."
Get a christmas card with a check from a forgotten relative- that's karma!
"I'm glad I called my grandma six months ago."
If there's an opportunity to relate something to karma or any belief, that person will take that opportunity every time. It's one of the simplest ways to give meaning to life. And having a purpose/meaning is one of the most important things in order to sustain a healthy life. That's on a large-scale but, like I said, karma goes beyond that. On the subject of 'simpler' life-matters, karma allows somebody to feel good about themselves even if they do bad things. Here's a hypothetical.
Jimmy the gangsta is a firm believer in karma. When he's not killing children for their candy he's constantly assessing his life under the scrutiny of karma. Occassionally he will scrape his knee or lose a dead homie to the streets and naturally he'll feel bad because of it.
"Daayum dood, my bro straight got popped, G. Dat's karma on tha real. Shouldn'ta capped doze bitches on foth street. Karma's a bitch!"
As we can see, Jimmy just justified killing the "bitches on foth" with an event completely unrelated to it. That hardship is now temporarily erased from his mind now that he believes that it's been justified or forgiven by his own unfortunate event.
Anyways, neither karma nor the "law" of attraction are bad beliefs. It's just important to understand why they work the way they do. Anything that puts a person into a positive mindframe is a good thing in my book. Once you can understand how they work though, you can go beyond the bounds and limitations they set on your control of your life. These beliefs simply focus your attention on a small scale of how your mind works and will ultimately hinder your mental progress toward acceptance of yourself because they close your mind to so many other aspects of thinking.