[Solved] Want to find the url from html tag [closed]

Try the below $(function() { var a_href = $(‘#website-view a’).attr(‘href’); var decodedUri = decodeURIComponent(a_href); var url = decodedUri.split(“url=”)[1].split(“&”)[0]; alert(url); }); <script src=”https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js”></script> <div id=”website-view”> <ul> <li> <a target=”_blank” href=”https://stackoverflow.com/redir/redirect?url=http%3A%2F%2Ffacebook%2Ecom%2Fshwet&amp;urlhash=GvM1″>My Facebook</a> </li> </ul> </div> 2 solved Want to find the url from html tag [closed]

[Solved] Java: Parameter list without comma

I’m guessing you’re new to programming, so I’ll give a quick explanation of what’s going on. If I’ve missed the point of your question entirely, I’m sorry. This line: public int compareWith(Choice anotherChoice){ is part of the Choice object. It takes another Choice object and compares it with itself. …or at least, that’s what I … Read more

[Solved] Default Back Button Text and Font Setting

Change your code in viewDidLoad like this. class BaseViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() } func setNavigationWithCustomBackButton() { let btnLeft:UIButton! = UIButton(frame: CGRectMake(0, 0, 20, 16)) btnLeft.setTitle(“<=|”, forState: .Normal) btnLeft.titleLabel?.font = UIFont.systemFontOfSize(19, weight: UIFontWeightLight) btnLeft!.addTarget(self, action: “handleBack:”,forControlEvents: UIControlEvents.TouchUpInside) let leftItem:UIBarButtonItem = UIBarButtonItem(customView: btnLeft!) self.navigationItem.leftBarButtonItem = leftItem } func handleBack(sender: UIButton) { self.navigationController?.popViewControllerAnimated(true) } … Read more

[Solved] List View can’t run [duplicate]

try this, xml <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”match_parent” android:layout_height=”match_parent” android:orientation=”vertical” > <TextView android:id=”@+id/output” android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:background=”#758AA7″ android:padding=”1px” android:text=”Click : ” android:textColor=”#ffffff” /> <ListView android:id=”@android:id/list” android:layout_width=”match_parent” android:layout_height=”wrap_content” > </ListView> </LinearLayout> MainActivity.java public class MainActivity extends ListActivity { TextView content; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.listview_main); content = (TextView) findViewById(R.id.output); String[] CoffeeShop = {“Creation”,”Starbucks”,”Caribou”,”Mo’Joe” … Read more

[Solved] NASM – Variable Basics

‘mystring + 1’ is the address of the second byte of the string. mov al, mystring + 1 stores (the least significant byte of) that address in al. To indicate that you don’t want to store the address but the byte located at that address, write this: mov al, [mystring + 1] To declare a … Read more

[Solved] Select the newest data in an SQL table? [closed]

first, please dont use ‘date’ as your field name, lets say you rename it as news_date. How about this? <?php $query = mysql_query (“SELECT * FROM yourtable ORDER BY id DESC LIMIT 3”); $number = 1; while ($result = mysql_fetch_array($query)) { $id = $result[‘id’]; $title = $result[‘title’]; $news_date = $result[‘news_date’]; $post = $result[‘post’]; ?> <div … Read more

[Solved] How does this while block work? [closed]

result and counter are separate variables with different goals in this code. counter is incremented like counter += 1 so that eventually the while condition while (counter<10) will be satisfied and the code will cease to execute. As for result, each time the code in the while block is executed, result is updated by multiplying … Read more

[Solved] PHP Random String Generator based on GET values [closed]

Your best bet is to use multiple GET arrays and conditional statements, and “echo” the function if it meets both conditions. <?php error_reporting(E_ALL); ini_set(‘display_errors’, 1); function randomString() { return rtrim(base64_encode(md5(microtime())),”=”); } if ( isset($_GET[‘userid’]) && !empty($_GET[‘userid’]) && isset($_GET[‘transactionid’]) && !empty($_GET[‘transactionid’]) ) { echo randomString(); } else{ echo “One GET array is not set or is … Read more

[Solved] Shuffle character array in C

Having char names[16][20] = …; char randomnames[16][20]; you cannot do randomnames[i] = names[j]; but char names[16][20] = …; char * randomnames[16]; … randomnames[i] = names[j]; or char names[16][20] = …; char randomnames[16][20]; … strcpy(randomnames[i], names[j]); Warning when I see your first version of the question you have to print names rather than randomnames, that means … Read more

[Solved] How can I rewrite the tags

The short form of <?php echo ?> is <?= ?> The other way to do it to use something like template engine check https://twig.symfony.com/ Check http://acmeextension.com/best-templating-engine/ for some like of the PHP template enginer 5 solved How can I rewrite the tags

[Solved] How to get only first object value key value [closed]

Just use array[0].value: var array = [{ label: “1”, value: “11” }, { label: “2”, value: “22” }, { label: “3”, value: “33” }, { label: “4”, value: “44” }, ]; var firstValue = array[0].value; console.log(firstValue); You can also use destructuring like so: var array = [{ label: “1”, value: “11” }, { label: “2”, … Read more

[Solved] Decimal Subtraction [closed]

So your code bugged me alot. I made some changes to make things more pythonic… Instead of separate lists for your menu, I made it a list of tuples containing the product and it’s price I fixed your float casts There’s alot to be done for example, catching errors on invalid inputs, checking for available … Read more

[Solved] How to gather the url text inside HTML-div via regular expression?

You should use DOMDocument and DOMXPath or something like that, but if you want it done with regexp, for your given html this should do the trick: <?php $html_code=”<a href=”https://stackoverflow.com/napolnye-pokrytiya/” class=”category_cart”> <div class=”category_cart__container”> <div style=”background-image: url(\”/media/filer_public/b6/49/b6491a4d-5c0d-4a0f-aa9c-b32ea39912c6/category-2.jpg\’)” class=”category_cart__thumbnail”></div> <div class=”category_cart__content”> <p class=”category_cart__title”>Напольные покрытия</p> </div> </div> </a> <a href=”http://stackoverflow.com/oboi/” class=”category_cart”> <div class=”category_cart__container”> <div style=”background-image: url(\’/media/filer_public/93/65/9365c3bc-8649-4d9d-932e-144f16ed535c/category-3.jpg\’)” class=”category_cart__thumbnail”></div> <div … Read more

[Solved] Vigenere Cipher c# with “ñ”

Your code: if (Char.IsLetter(s[i])) { s[i] = (char)(s[i] + key[j] – ‘A’); if (s[i] > ‘Z’) s[i] = (char)(s[i] – ‘Z’ + ‘A’ – 1); } Depends on the fact that the letters from U+0041 to U+005A just happen to match a the letters of the alphabets of some languages, such as English*. (If the … Read more