Skip to content

v1.1.0

Compare
Choose a tag to compare
@HamzaElkotp HamzaElkotp released this 22 Sep 18:02

making JSON objects order unnecessary

  • adding data.forEach function in elements.forEach function.
  • data.forEach is created to loop through data and search on the object that owns the same SPAname that is in clicked element.
  • while it looping it compares every object's SPAname value with clicked element SPAname meta tag.
  • if they are the same it'll change window.title to SPAtitle that is in that object.
  • also will append the SPAurl to the window URL using window.history.pushState.

NOTE: I moved document.title = data[index][SPAtitle]; & window.history.pushState("","",data[index][SPAurl]); inside if condition that is in data.forEach.