Jump to content

Very simple javascript, need to pass values via url


Go to solution Solved by Jason28,

Recommended Posts

I have spent so many years trying to figure out javascript and just cannot learn it.  Especially when all of the code is correct but it doesn't work.  Anyway, I need a very simple javascript code that everyone here should know please...  I want to pass two values via a url, to another spot on the same webpage.  So like a url with javascript function (50,60) will change the values of the an iframe on that page from <iframe style="height: 50px, width:60px">.  So I will pass the height and width values to the iframe on the page when I click on a url.  Please provide full code thanks :)

I have spent so many years trying to figure out javascript and just cannot learn it.  Especially when all of the code is correct but it doesn't work.  Anyway, I need a very simple javascript code that everyone here should know please...  I want to pass two values via a url, to another spot on the same webpage.  So like a url with javascript function (50,60) will change the values of the an iframe on that page from <iframe style="height: 50px, width:60px">.  So I will pass the height and width values to the iframe on the page when I click on a url.  Please provide full code thanks :)

 

you want jquery buddy, search stackoverflow for keywords. also, this is not a help site. in general, people won't write code for you, but if you put forth the effort to try, your effort will be rewarded with our help.

 

thanks, 

            r3wt

 

here's those keywords if you're lazy and want to search stack overflow and hack something together. we've all been there.

 

pass value to html element parameters with jquery

Hmm I doubt I need jquery for that since I have seen javascript do that years before jquery or ajax was even invented.  This is not a help site?  It has been helping people for years.  I cannot find my answer on stackoverflow, I have been searching for hours.  I work 14 hours per day at my full time job and code after that so I am far from lazy.

Edited by Jason28

Well, it's by far easier with jQuery if you want to pass form information or something you can use .serialize(). You could use .serializeArray() to keep things easier and cleaner. It sounds like all you want to do is use window.location and set it to something like "http://mysite.com/?var=this&var2=that".

 

You can say "screw jQuery", but the truth is that it makes just about everything so much easier.

 

in general, people won't write code for you, but if you put forth the effort to try, your effort will be rewarded with our help.

That is the main thing you should have paid attention to from his post. If you want help, you should put some effort into trying it and show us that you have. Just coming and asking for code isn't going to get you very far. There's a freelance section for that stuff.

 

Also, no. You don't need jQuery for anything. It makes things a hell of a lot easier though, and a lot of times lets you do much less work for the same or better result. You don't need a lawn mower to cut your grass. Scissors work, but it would be a pain in the ass.

Edited by Xaotique

Well, it's by far easier with jQuery if you want to pass form information or something you can use .serialize(). You could use .serializeArray() to keep things easier and cleaner. It sounds like all you want to do is use window.location and set it to something like "http://mysite.com/?var=this&var2=that".

 

You can say "screw jQuery", but the truth is that it makes just about everything so much easier.

 

 

That is the main thing you should have paid attention to from his post. If you want help, you should put some effort into trying it and show us that you have. Just coming and asking for code isn't going to get you very far. There's a freelance section for that stuff.

 

Also, no. You don't need jQuery for anything. It makes things a hell of a lot easier though, and a lot of times lets you do much less work for the same or better result. You don't need a lawn mower to cut your grass. Scissors work, but it would be a pain in the ass.

Just to grab up the point of your last paragraph...

jQuery makes everything easier, but if you're really, really, really (and I mean really) concerned about your page load and those few milliseconds it takes to load jQuery from Google APIs (or directly from code.jquery.com), then using vanilla JS is often the more straightforward approach (but nevertheless more verbose; it also doesn't provide very useful utility functions).

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.